Regenerated
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
bt_connected=""
|
||||
while read -r _ mac name_rest; do
|
||||
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
||||
bt_connected+="$name_rest\n"
|
||||
fi
|
||||
done < <(bluetoothctl devices)
|
||||
# icon
|
||||
if [ -n "$bt_connected" ]; then
|
||||
icon=""
|
||||
tooltip=$(printf "%b" "$bt_connected")
|
||||
else
|
||||
icon=""
|
||||
tooltip="No devices connected"
|
||||
fi
|
||||
# ALWAYS produce valid JSON
|
||||
printf '{"text": "%s", "tooltip": "%s"}\n' "$icon" "$tooltip"
|
||||
Reference in New Issue
Block a user