Regenerated
This commit is contained in:
@@ -8,12 +8,15 @@ bt_connected=$(bluetoothctl devices | while read -r line; do
|
||||
fi
|
||||
done | sed '/^$/d') # remove empty lines
|
||||
|
||||
# Determine the icon
|
||||
# Determine icon
|
||||
if [ -n "$bt_connected" ]; then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
|
||||
# Output valid JSON for Waybar
|
||||
# Escape for JSON
|
||||
bt_connected_json=$(printf '%s' "$bt_connected" | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
|
||||
|
||||
# Output single JSON object
|
||||
echo "{\"text\": \"$icon\", \"tooltip\": \"$bt_connected_json\"}"
|
||||
|
||||
Reference in New Issue
Block a user