cleaned up error codes
This commit is contained in:
parent
6d993c3a7e
commit
57d4590b2b
@ -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
|
#Don't print empty device list, removes unnecessary empty choice in dmenu
|
||||||
len=$(cat /tmp/disp_devices | wc -l)
|
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 -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(){
|
cleanup(){
|
||||||
rm -f /tmp/bt_devices
|
rm -f /tmp/bt_devices
|
||||||
@ -29,10 +29,9 @@ cleanup(){
|
|||||||
rm -f /tmp/new_devices
|
rm -f /tmp/new_devices
|
||||||
rm -f /tmp/disp_devices
|
rm -f /tmp/disp_devices
|
||||||
bluetoothctl scan off > /dev/null
|
bluetoothctl scan off > /dev/null
|
||||||
exit
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case $choice in
|
case $choice in
|
||||||
"turn on") bluetoothctl power on
|
"turn on") bluetoothctl power on
|
||||||
cleanup;;
|
cleanup;;
|
||||||
|
Loading…
Reference in New Issue
Block a user