Add readme and start of rofi slack plugin
This commit is contained in:
23
README.org
Normal file
23
README.org
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#+TITLE: Dotfiles
|
||||||
|
|
||||||
|
I use:
|
||||||
|
|
||||||
|
+-----+--------------------+
|
||||||
|
| OS | FreeBSD 12.1 |
|
||||||
|
+-----+--------------------+
|
||||||
|
| WM | i3-gaps |
|
||||||
|
+-----+--------------------+
|
||||||
|
| Compositor | compton |
|
||||||
|
+-----+--------------------+
|
||||||
|
| Editor | DOOM Emacs |
|
||||||
|
+-----+--------------------+
|
||||||
|
| Terminal | Alacritty |
|
||||||
|
+-----+--------------------+
|
||||||
|
| Shell | fish |
|
||||||
|
+-----+--------------------+
|
||||||
|
| PDF-viewer | Zathura |
|
||||||
|
+-----+--------------------+
|
||||||
|
| Mail | notmuch + Emacs |
|
||||||
|
+-----+--------------------+
|
||||||
|
| Browser | Firefox / surf |
|
||||||
|
+-----+--------------------+
|
||||||
58
rofi/.config/rofi/slack.sh
Executable file
58
rofi/.config/rofi/slack.sh
Executable file
@ -0,0 +1,58 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Info:
|
||||||
|
# author: Colin Powell
|
||||||
|
# file: slack.sh
|
||||||
|
# created: 20.03.2020
|
||||||
|
# revision: ---
|
||||||
|
# version: 1.0
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Requirements:
|
||||||
|
# rofi
|
||||||
|
# Description:
|
||||||
|
# Use rofi to update slack
|
||||||
|
# Usage:
|
||||||
|
# slack.sh
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Script:
|
||||||
|
|
||||||
|
declare -A OPTIONS
|
||||||
|
|
||||||
|
OPTIONS=(
|
||||||
|
["set status"]="slack status edit "
|
||||||
|
["clear status"]="slack status edit "
|
||||||
|
["set away"]="slack presence away"
|
||||||
|
["set available"]="slack presence active"
|
||||||
|
)
|
||||||
|
|
||||||
|
# List for rofi
|
||||||
|
gen_list() {
|
||||||
|
for i in "${!OPTIONS[@]}"
|
||||||
|
do
|
||||||
|
echo "$i"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
# Pass the list to rofi
|
||||||
|
platform=$( (gen_list) | rofi -dmenu -matching fuzzy -no-custom -location 0 -p "Command -> " )
|
||||||
|
|
||||||
|
if [[ -n "$platform" ]]; then
|
||||||
|
query=$( (echo ) | rofi -dmenu -matching fuzzy -location 0 -p "Input -> " )
|
||||||
|
|
||||||
|
if [[ -n "$query" ]]; then
|
||||||
|
option=${OPTIONS[$platform]}$query
|
||||||
|
eval "$option"
|
||||||
|
else
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user