diff options
| author | 0scar <qgt268@alumni.ku.dk> | 2022-09-23 10:32:37 +0000 |
|---|---|---|
| committer | 0scar <qgt268@alumni.ku.dk> | 2022-09-23 10:32:37 +0000 |
| commit | 53d73b28d6caa64c80fd59f4bb0cd7087cc2333c (patch) | |
| tree | 018d5f67e2014545bc40e37bb38901e1bf837b4f /.local/bin | |
| parent | 70996a90d42991c519e0aca4e7ef744a251a5640 (diff) | |
Update bt script
New syntax to show paired devices with bluetoothctl
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/bt | 4 |
1 files 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 |
