Regenerated

This commit is contained in:
2026-03-31 22:08:17 +02:00
parent 0c95c145bb
commit 4c95858152
3 changed files with 296 additions and 295 deletions
+285 -285
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -2988,24 +2988,24 @@ window#waybar {
These are config files for waybar
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/bluetooth-status.sh :noweb yes :mkdirp yes :eval never
#!/usr/bin/env bash
# Collect connected devices
bt_connected=$(bluetoothctl devices | while read -r line; do
mac=$(echo "$line" | awk '{print $2}')
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
echo "$line" | cut -d' ' -f3-
fi
done)
done | sed '/^$/d') # remove empty lines
# Determine the icon
if [ -n "$bt_connected" ]; then
icon=""
else
icon=""
fi
# Output: main icon for Waybar, then connected devices for tooltip
echo -n "$icon"
# Pass connected device names as JSON output for Waybar tooltip
echo "$bt_connected" | jq -R -s '{output: .}'
# Output valid JSON for Waybar
jq -n --arg text "$icon" --arg tooltip "$bt_connected" '{text: $text, tooltip: $tooltip}'
#+END_SRC
@@ -1,18 +1,19 @@
#!/usr/bin/env bash
# Collect connected devices
bt_connected=$(bluetoothctl devices | while read -r line; do
mac=$(echo "$line" | awk '{print $2}')
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
echo "$line" | cut -d' ' -f3-
fi
done)
done | sed '/^$/d') # remove empty lines
# Determine the icon
if [ -n "$bt_connected" ]; then
icon=""
else
icon=""
fi
# Output: main icon for Waybar, then connected devices for tooltip
echo -n "$icon"
# Pass connected device names as JSON output for Waybar tooltip
echo "$bt_connected" | jq -R -s '{output: .}'
# Output valid JSON for Waybar
jq -n --arg text "$icon" --arg tooltip "$bt_connected" '{text: $text, tooltip: $tooltip}'