2023-11-13 16:01:23 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2023-11-14 12:31:18 +00:00
|
|
|
action=$(printf "move\nfetch\naway\nnot away\nback" | $DMENU)
|
2023-11-13 16:01:23 +00:00
|
|
|
|
|
|
|
ts_control_move_self() {
|
2023-11-14 12:31:18 +00:00
|
|
|
channel=$(teamspeak-query-lib channels | $DMENU)
|
|
|
|
if [ -z "$channel" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
teamspeak-query-lib move --strict-channel "$channel"
|
|
|
|
return 0
|
2023-11-13 16:01:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case $action in
|
|
|
|
"move")
|
2023-11-14 12:31:18 +00:00
|
|
|
ts_control_move_self
|
|
|
|
;;
|
|
|
|
"fetch")
|
|
|
|
client=$(teamspeak-query-lib clients | $DMENU)
|
|
|
|
if [ -z "$client" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
teamspeak-query-lib fetch --strict-client "$client"
|
|
|
|
;;
|
|
|
|
"not away")
|
|
|
|
teamspeak-query-lib move "Not Away From Keyboard"
|
|
|
|
teamspeak-query-lib update --microphone=false --speakers=false
|
2023-11-13 16:01:23 +00:00
|
|
|
;;
|
|
|
|
"away")
|
2023-11-14 12:31:18 +00:00
|
|
|
message=$(printf "\n" | $DMENU -p "message")
|
|
|
|
if [ -z "$message" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-11-13 16:01:23 +00:00
|
|
|
teamspeak-query-lib move "Away From Keyboard"
|
|
|
|
teamspeak-query-lib update --away "$message"
|
|
|
|
teamspeak-query-lib update --microphone=false --speakers=false --away "$message"
|
|
|
|
;;
|
|
|
|
"back")
|
|
|
|
teamspeak-query-lib update --back
|
2023-11-14 12:31:18 +00:00
|
|
|
ts_control_move_self
|
2023-11-13 16:01:23 +00:00
|
|
|
teamspeak-query-lib update --microphone=true --speakers=true
|
|
|
|
;;
|
|
|
|
esac
|