2022-10-31 21:00:11 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
regex="([0-9A-Z]*:)+"
|
|
|
|
DEVICES=$(bluetoothctl devices)
|
2023-05-19 12:22:02 +01:00
|
|
|
ICON=""
|
2022-10-31 21:00:11 +00:00
|
|
|
COLOR="#696B71"
|
|
|
|
for DEVICE in $DEVICES
|
|
|
|
do
|
|
|
|
if [[ $DEVICE =~ $regex ]]; then
|
|
|
|
STATUS=$(bluetoothctl info $DEVICE | grep "Connected" | awk '{print $2}')
|
|
|
|
if [ $STATUS = "yes" ]; then
|
2023-05-19 12:22:02 +01:00
|
|
|
ICON=""
|
2022-10-31 21:00:11 +00:00
|
|
|
COLOR="#DFDFDF"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2022-11-01 01:13:27 +00:00
|
|
|
echo "<fc=$COLOR><fn=3>$ICON</fn></fc>"
|