summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSaumit Dinesan <79687674+justsaumit@users.noreply.github.com>2022-02-26 11:36:14 +0530
committerGitHub <noreply@github.com>2022-02-26 11:36:14 +0530
commit4afe838d8a66f59e30cf3e671fd6381d8310229d (patch)
tree3302a7285e259d9f36b9b7d08a2e63629c1eb42c /scripts
parent584dd7d7c6ac75f70ceaeec969ff7f6ba7c4457d (diff)
Update bts
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bts10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/bts b/scripts/bts
index 0929f73..3e91f35 100644
--- a/scripts/bts
+++ b/scripts/bts
@@ -4,8 +4,8 @@ case $status in
"active")
bluetoothctl power on
bluetoothctl connect A1:B3:EC:B1:53:60 && sleep 5 &&
- pmstat=$(pactl list | grep "Active Profile" | sed '2p;d' | cut -d ' ' -f 3)
- [ "$pmstat" = ("a2dp_sink" || "handsfree_head_unit") ] && notify-send "Bluetooth Device is connected"|| notify-send "Unable to connect! Check whether the bluetooth device is switched on.";;
+ pmstat=$(pactl list | grep "Active Profile" | sed '2p;d' | cut -d ' ' -f 3)
+ [ -n "$pmstat" ] && notify-send "Bluetooth Device is connected"|| notify-send "Unable to connect! Check whether the bluetooth device is switched on.";;
"inactive" | "failed")
export SUDO_ASKPASS=/home/saumit/.scripts/dpass
@@ -14,6 +14,6 @@ case $status in
notify-send "Bluetooth daemon is running"
bluetoothctl power on
bluetoothctl connect A1:B3:EC:B1:53:60 &&
- pmstat=$(pactl list | grep "Active Profile" | sed '2p;d' | cut -d ' ' -f 3)
- [ "$pmstat" = "a2dp_sink" ] && notify-send "Bluetooth Device is connected" || notify-send "Unable to connect! Check whether the bluetooth device is switched on.";;
-esac
+ pmstat=$(pactl list | grep "Active Profile" | sed '2p;d' | cut -d ' ' -f 3)
+ [ -n "$pmstat" ] && notify-send "Bluetooth Device is connected" || notify-send "Unable to connect! Check whether the bluetooth device is switched on.";;
+ esac