Add readme and start of rofi slack plugin

This commit is contained in:
Colin Powell
2020-03-26 09:28:36 -04:00
parent 939d5ed8f9
commit e37d7133ed
2 changed files with 81 additions and 0 deletions

58
rofi/.config/rofi/slack.sh Executable file
View 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