From 53d73b28d6caa64c80fd59f4bb0cd7087cc2333c Mon Sep 17 00:00:00 2001 From: 0scar Date: Fri, 23 Sep 2022 12:32:37 +0200 Subject: Update bt script New syntax to show paired devices with bluetoothctl --- .local/bin/bt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/bt b/.local/bin/bt index c53ec5f..9d40a67 100755 --- a/.local/bin/bt +++ b/.local/bin/bt @@ -14,7 +14,7 @@ BTID='^([A-F0-9]{2}:){5}[A-F0-9]{2}$' if [ $# -gt 0 ]; then if [ "$#" -eq 1 ]; then - PAIRED=$(bluetoothctl paired-devices | grep "$1" | awk '/Device/ {print $2}') + PAIRED=$(bluetoothctl devices Paired | grep "$1" | awk '/Device/ {print $2}') if [ $(echo "$1" | grep -E $BTID) ]; then bluetoothctl connect $1 elif [ $(echo "$PAIRED" | grep -E $BTID) ]; then bluetoothctl connect $PAIRED @@ -25,7 +25,7 @@ if [ $# -gt 0 ]; then else CONNECTED="$(bluetoothctl info | awk '/Name/ {print $2}')" || true - bluetoothctl paired-devices | awk "/Device/ {if(\"$CONNECTED\"==\$3) print \"\033[1;32m\" \$2 \"\t\" \$3 \"\033[0m\"; else print \$2 \"\t\" \$3;}" + bluetoothctl devices Paired | awk "/Device/ {if(\"$CONNECTED\"==\$3) print \"\033[1;32m\" \$2 \"\t\" \$3 \"\033[0m\"; else print \$2 \"\t\" \$3;}" fi sigdwmblocks 4 -- cgit v1.3