teamspeak-query-lib/ts-control

44 lines
1 KiB
Text
Raw Normal View History

2023-11-13 16:01:23 +00:00
#!/usr/bin/env sh
action=$(printf "move\nfetch\naway\nnot away\nback" | $DMENU)
2023-11-13 16:01:23 +00:00
ts_control_move_self() {
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")
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")
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
ts_control_move_self
2023-11-13 16:01:23 +00:00
teamspeak-query-lib update --microphone=true --speakers=true
;;
esac