added hidden blacklist menu

This commit is contained in:
Alexander Bocken 2020-07-04 20:50:23 +02:00
parent 898ea9dc74
commit c1508ba5f6
2 changed files with 6 additions and 1 deletions

View File

@ -45,5 +45,5 @@ Here's a growing list of features that are not yet actively worked on but might
- start scanning for new devices immediately at execution to save time when pairing new devices -> *Implemented*
- auto-trust newly paired devices/trust device via dmenu -> *Implemented changeable via the AUTOTRUST variable in the beginning of bt, menu display adjusts accordingly*
- blacklist devices via dmenu
- blacklist devices via dmenu -> *Implemented* (action is hidden, but typing `blacklist` as your choice will reveal the menu)
- update bthandler internal paired devices list if something new shows up via `bluetoothctl paired-devices` not already listed in the paired devices file -> *Implemented*

5
bt
View File

@ -161,6 +161,11 @@ case $choice in
dev_id=$( echo "$bt_IDS" | nl | grep -P "^.*$dev_no\t" | awk '{print $2}' )
bluetoothctl disconnect "$dev_id"
fi;;
"blacklist")
choice=$( echo "$paired_devices" | dmenu -l 10 -i -p 'blacklist which paired device from selection?')
if [ -n "$choice" ]; then
echo "$choice" >> "$BLACKLIST"
fi;;
*)
echo "$choice"
dev_no=$( echo "$paired_devices" | nl | grep -P "[0-9]+\t$choice$" | awk '{print $1}')