dotfiles/.config/xmobar/scripts/bluetooth.sh
afonsofrancof f6b77a9118 Icon fixes
2022-11-01 01:13:27 +00:00

18 lines
391 B
Bash
Executable file

#!/bin/bash
regex="([0-9A-Z]*:)+"
DEVICES=$(bluetoothctl devices)
ICON=""
COLOR="#696B71"
for DEVICE in $DEVICES
do
if [[ $DEVICE =~ $regex ]]; then
STATUS=$(bluetoothctl info $DEVICE | grep "Connected" | awk '{print $2}')
if [ $STATUS = "yes" ]; then
ICON=""
COLOR="#DFDFDF"
fi
fi
done
echo "<fc=$COLOR><fn=3>$ICON</fn></fc>"