From 970c1ee2c26536c40b3fd04623fabe8468b0963f Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Tue, 14 Nov 2023 13:31:18 +0100 Subject: [PATCH] Fix space/tab and add "not away" in ts-control --- ts-control | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/ts-control b/ts-control index 30912b4..fcfbb21 100755 --- a/ts-control +++ b/ts-control @@ -1,39 +1,43 @@ #!/usr/bin/env sh -action=$(printf "move\nfetch\naway\nback" | $DMENU) +action=$(printf "move\nfetch\naway\nnot away\nback" | $DMENU) 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 + channel=$(teamspeak-query-lib channels | $DMENU) + if [ -z "$channel" ]; then + return 1 + fi + teamspeak-query-lib move --strict-channel "$channel" + return 0 } case $action in "move") - ts_control_move_self + 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 ;; - "fetch") - client=$(teamspeak-query-lib clients | $DMENU) - if [ -z "$client" ]; then - exit 1 - fi - teamspeak-query-lib fetch --strict-client "$client" - ;; "away") - message=$(printf "\n" | $DMENU -p "message") - if [ -z "$message" ]; then - exit 1 - fi + message=$(printf "\n" | $DMENU -p "message") + if [ -z "$message" ]; then + exit 1 + fi 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 + ts_control_move_self teamspeak-query-lib update --microphone=true --speakers=true ;; esac