Reduced hanging possibilities due to `bluetoothctl` in Polybar bluetooth script, making it check if kernel module is loaded and a BT card is plugged

master
Meliurwen 3 years ago
parent c539adefda
commit 30734e2010
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 11
      polybar/.config/polybar/scripts/bluetooth.sh

@ -1,6 +1,17 @@
#!/bin/sh
# Usage: ./bluetooth.sh [--toggle]
set -e
# If the folder doesn't exist (kernel module not loaded) or it's empty, exit
if [ ! -d /sys/class/bluetooth ]; then
exit 1
elif [ -z "$(ls -A /sys/class/bluetooth)" ]; then
exit 1
else
:
fi
case $1 in
"")
bt_color=""

Loading…
Cancel
Save