From 0e480a3e2da88d58d76b51fdea2a4f68228c51be Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Fri, 2 Jul 2021 11:28:06 +0200 Subject: [PATCH] fix non-display of "disconnect" action. Add option to enable this --- bt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bt b/bt index 6be307e..549be90 100755 --- a/bt +++ b/bt @@ -12,6 +12,9 @@ PAIRLIST=${XDG_CONFIG_HOME:-$HOME/.config}/bt/paired ALIASLIST=${XDG_CONFIG_HOME:-$HOME/.config}/bt/alias actions="$(printf 'pair\nunpair\n')" +#disconnect menu does not need to be displayed since just directly selecting the connected device will disconnect it +#set to anything non-empty to enable +include_disconnect_option="" [ "$AUTOTRUST" = false ] && actions="$(printf '%s\ntrust\n' "$actions")" @@ -84,7 +87,9 @@ connected_devices="$(echo "$connected_ids" | while read -r id; do fi done)" -[ -z "$connected_devices" ] && actions="$(printf "disconnect\n%s" "$actions")" +[ -n "$include_disconnect_option" ] && + [ -n "$connected_devices" ] && + actions="$(printf "disconnect\n%s" "$actions")" #Compile list of all Bluetooth IDS of paired devices (from bluetoothctl and from hardcoded list) bt_IDS="$( ( bluetoothctl paired-devices && cat "$PAIRLIST" ) | awk '{print $2}' | sort -u )"