cleaned up error codes

This commit is contained in:
Alexander Bocken 2020-05-23 15:42:33 +02:00
parent 6d993c3a7e
commit 57d4590b2b

View File

@ -19,8 +19,8 @@ grep -vf "$BLACKLIST" /tmp/paired_devices > /tmp/disp_devices
#Don't print empty device list, removes unnecessary empty choice in dmenu
len=$(cat /tmp/disp_devices | wc -l)
[ $len -gt 0 ] && choice=$( printf "$(< /tmp/disp_devices)\n$actions" | dmenu -i -p 'What BT action would you like to perform:' )
[ $len -eq 0 ] && choice=$( printf "$actions" | dmenu -i -p 'What BT action would you like to perform:' )
[ $len -gt 0 ] && choice=$( printf "$(< /tmp/disp_devices)\n$actions" | dmenu -i -p 'What BT action would you like to perform:' )
cleanup(){
rm -f /tmp/bt_devices
@ -29,10 +29,9 @@ cleanup(){
rm -f /tmp/new_devices
rm -f /tmp/disp_devices
bluetoothctl scan off > /dev/null
exit
exit 0
}
case $choice in
"turn on") bluetoothctl power on
cleanup;;