Regenerated
This commit is contained in:
+285
-285
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -2988,24 +2988,24 @@ window#waybar {
|
|||||||
These are config files for waybar
|
These are config files for waybar
|
||||||
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/bluetooth-status.sh :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC sh :tangle generated/.config/waybar/scripts/bluetooth-status.sh :noweb yes :mkdirp yes :eval never
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Collect connected devices
|
# Collect connected devices
|
||||||
bt_connected=$(bluetoothctl devices | while read -r line; do
|
bt_connected=$(bluetoothctl devices | while read -r line; do
|
||||||
mac=$(echo "$line" | awk '{print $2}')
|
mac=$(echo "$line" | awk '{print $2}')
|
||||||
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
||||||
echo "$line" | cut -d' ' -f3-
|
echo "$line" | cut -d' ' -f3-
|
||||||
fi
|
fi
|
||||||
done)
|
done | sed '/^$/d') # remove empty lines
|
||||||
|
|
||||||
# Determine the icon
|
# Determine the icon
|
||||||
if [ -n "$bt_connected" ]; then
|
if [ -n "$bt_connected" ]; then
|
||||||
icon=""
|
icon=""
|
||||||
else
|
else
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
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
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Collect connected devices
|
# Collect connected devices
|
||||||
bt_connected=$(bluetoothctl devices | while read -r line; do
|
bt_connected=$(bluetoothctl devices | while read -r line; do
|
||||||
mac=$(echo "$line" | awk '{print $2}')
|
mac=$(echo "$line" | awk '{print $2}')
|
||||||
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
||||||
echo "$line" | cut -d' ' -f3-
|
echo "$line" | cut -d' ' -f3-
|
||||||
fi
|
fi
|
||||||
done)
|
done | sed '/^$/d') # remove empty lines
|
||||||
|
|
||||||
# Determine the icon
|
# Determine the icon
|
||||||
if [ -n "$bt_connected" ]; then
|
if [ -n "$bt_connected" ]; then
|
||||||
icon=""
|
icon=""
|
||||||
else
|
else
|
||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
# Output: main icon for Waybar, then connected devices for tooltip
|
|
||||||
echo -n "$icon"
|
# Output valid JSON for Waybar
|
||||||
# Pass connected device names as JSON output for Waybar tooltip
|
jq -n --arg text "$icon" --arg tooltip "$bt_connected" '{text: $text, tooltip: $tooltip}'
|
||||||
echo "$bt_connected" | jq -R -s '{output: .}'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user