From 5cd8449c399c939f0632a7346ec3f4e9cd3a4f08 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sat, 8 Oct 2022 16:28:27 +0200 Subject: Conditionally swap Escape and Caps. --- bluetooth/btConnect.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bluetooth') diff --git a/bluetooth/btConnect.sh b/bluetooth/btConnect.sh index 71bb93b..9d97938 100755 --- a/bluetooth/btConnect.sh +++ b/bluetooth/btConnect.sh @@ -26,16 +26,16 @@ if bluetoothctl show | grep -Fq 'Powered: no'; then fi lines=$(bluetoothctl devices Paired | wc -l) -selected=$(bluetoothctl devices Paired | dmenu -l $lines -p "💓") || exit 1 -mac=$(echo $selected | cut -d' ' -f2) -name=$(echo $selected | cut -d' ' -f3-) +selected=$(bluetoothctl devices Paired | dmenu -l "$lines" -p "💓") || exit 1 +mac=$(echo "$selected" | cut -d' ' -f2) +name=$(echo "$selected" | cut -d' ' -f3-) -if bluetoothctl info $mac | grep -F 'Connected' | grep -Fq 'yes'; then +if bluetoothctl info "$mac" | grep -F 'Connected' | grep -Fq 'yes'; then notify-send "$title" "Already connected to ${name}\n(${mac})" exit 2 fi -if ! bluetoothctl connect $mac; then +if ! bluetoothctl connect "$mac"; then notify-send "$title" "Unable to connect to ${name}\n(${mac})" exit 3 fi -- cgit v1.2.1