dotfiles/.config/sketchybar/plugins/bluetooth.sh
2026-06-03 14:36:50 -04:00

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