Regenerated
This commit is contained in:
+285
-282
File diff suppressed because it is too large
Load Diff
+5
-2
@@ -2997,14 +2997,17 @@ bt_connected=$(bluetoothctl devices | while read -r line; do
|
|||||||
fi
|
fi
|
||||||
done | sed '/^$/d') # remove empty lines
|
done | sed '/^$/d') # remove empty lines
|
||||||
|
|
||||||
# Determine the icon
|
# Determine icon
|
||||||
if [ -n "$bt_connected" ]; then
|
if [ -n "$bt_connected" ]; then
|
||||||
icon=""
|
icon=""
|
||||||
else
|
else
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
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\"}"
|
echo "{\"text\": \"$icon\", \"tooltip\": \"$bt_connected_json\"}"
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,15 @@ bt_connected=$(bluetoothctl devices | while read -r line; do
|
|||||||
fi
|
fi
|
||||||
done | sed '/^$/d') # remove empty lines
|
done | sed '/^$/d') # remove empty lines
|
||||||
|
|
||||||
# Determine the icon
|
# Determine icon
|
||||||
if [ -n "$bt_connected" ]; then
|
if [ -n "$bt_connected" ]; then
|
||||||
icon=""
|
icon=""
|
||||||
else
|
else
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
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\"}"
|
echo "{\"text\": \"$icon\", \"tooltip\": \"$bt_connected_json\"}"
|
||||||
|
|||||||
Reference in New Issue
Block a user