From 06dd5537f74b9f6a4cd0db8b200336a74c71ad37 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 4 Jul 2020 21:01:57 +0200 Subject: [PATCH] rearranged actions in a more logical order --- bt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bt b/bt index de98512..5874275 100755 --- a/bt +++ b/bt @@ -6,8 +6,8 @@ AUTOTRUST=false BLACKLIST=${XDG_DATA_HOME:-$HOME/.local/share}/bt/blacklist PAIRLIST=${XDG_DATA_HOME:-$HOME/.local/share}/bt/paired -actions="pair -disconnect +actions="disconnect +pair unpair" [ "$AUTOTRUST" = false ] && actions="${actions} @@ -69,8 +69,8 @@ disp_devices="$( echo "$paired_devices" | grep -vf "$BLACKLIST" )" #detects current power mode of controller and adjusts options accordingly poweroption="$( echo "$powerstatus" | sed 's/yes/power off/; s/no/power on/' )" #Don't print empty device list, removes unnecessary empty choice in dmenu -[ "$disp_devices" = "" ] && choice=$( printf "%s\n%s" "$poweroption" "$actions" | dmenu -i -p 'What BT action would you like to perform:' ) -[ "$disp_devices" != "" ] && choice=$( ( echo "$disp_devices" && printf "%s\n%s" "$poweroption" "$actions" ) | dmenu -i -p 'What BT action would you like to perform:' ) +[ "$disp_devices" = "" ] && choice=$( printf "%s\n%s" "$actions" "$poweroption" | dmenu -i -p 'What BT action would you like to perform:' ) +[ "$disp_devices" != "" ] && choice=$( ( echo "$disp_devices" && printf "%s\n%s" "$actions" "$poweroption" ) | dmenu -i -p 'What BT action would you like to perform:' ) cleanup(){ scan off