Add fetch-channel command
This commit is contained in:
parent
970c1ee2c2
commit
244a7073fe
9 changed files with 183 additions and 54 deletions
28
ts-control
28
ts-control
|
@ -1,6 +1,13 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
action=$(printf "move\nfetch\naway\nnot away\nback" | $DMENU)
|
||||
actions="move
|
||||
fetch-client
|
||||
fetch-channel
|
||||
away
|
||||
not away
|
||||
back"
|
||||
action=$(echo "$actions" | $DMENU)
|
||||
|
||||
|
||||
ts_control_move_self() {
|
||||
channel=$(teamspeak-query-lib channels | $DMENU)
|
||||
|
@ -11,16 +18,23 @@ ts_control_move_self() {
|
|||
return 0
|
||||
}
|
||||
|
||||
ts_control_fetch() {
|
||||
target=$(teamspeak-query-lib "$1s" | $DMENU)
|
||||
if [ -z "$target" ]; then
|
||||
exit 1
|
||||
fi
|
||||
teamspeak-query-lib fetch "--strict-$1" "--$1" "$target"
|
||||
}
|
||||
|
||||
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"
|
||||
"fetch-client")
|
||||
ts_control_fetch client
|
||||
;;
|
||||
"fetch-channel")
|
||||
ts_control_fetch channel
|
||||
;;
|
||||
"not away")
|
||||
teamspeak-query-lib move "Not Away From Keyboard"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue