From c1508ba5f6b5adef0da9c7e9d310f764ef196ed8 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 4 Jul 2020 20:50:23 +0200 Subject: [PATCH] added hidden blacklist menu --- README.md | 2 +- bt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6442b23..096a0cb 100644 --- a/README.md +++ b/README.md @@ -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* diff --git a/bt b/bt index 8523ea6..de98512 100755 --- a/bt +++ b/bt @@ -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}')