mirror of
https://github.com/mr0xb/dotfiles.git
synced 2026-08-27 19:34:57 -04:00
16 lines
No EOL
569 B
Shell
Executable file
16 lines
No EOL
569 B
Shell
Executable file
#!/bin/bash
|
|
|
|
# Check Bluetooth status
|
|
BT_STATUS=$(system_profiler SPBluetoothDataType 2>/dev/null | grep "Bluetooth Power" | awk '{print $3}')
|
|
|
|
if [ "$BT_STATUS" = "On" ]; then
|
|
# Check if any devices are connected
|
|
CONNECTED=$(system_profiler SPBluetoothDataType 2>/dev/null | grep "Connected: Yes" | wc -l)
|
|
if [ $CONNECTED -gt 0 ]; then
|
|
sketchybar --set "$NAME" icon="" icon.color=0xfffacc15
|
|
else
|
|
sketchybar --set "$NAME" icon="" icon.color=0xffffffff
|
|
fi
|
|
else
|
|
sketchybar --set "$NAME" icon="" icon.color=0xff6272a4
|
|
fi |