Regenerated
This commit is contained in:
+291
-291
File diff suppressed because it is too large
Load Diff
+11
-11
@@ -2711,7 +2711,7 @@ These are config files for waybar
|
||||
"tooltip": true,
|
||||
"tooltip-format": "Connected devices:\n{output}",
|
||||
"on-click": "blueman-manager"
|
||||
}
|
||||
},
|
||||
|
||||
"cpu": {
|
||||
"format": "{usage}% ",
|
||||
@@ -2988,23 +2988,23 @@ 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
|
||||
# Get connected devices
|
||||
# Collect connected devices
|
||||
bt_connected=$(bluetoothctl devices | while read -r line; do
|
||||
mac=$(echo "$line" | awk '{print $2}')
|
||||
state=$(bluetoothctl info "$mac" | grep "Connected" | awk '{print $2}')
|
||||
if [ "$state" = "yes" ]; then
|
||||
name=$(echo "$line" | cut -d' ' -f3-)
|
||||
echo "$name"
|
||||
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
||||
echo "$line" | cut -d' ' -f3-
|
||||
fi
|
||||
done)
|
||||
# Main icon for Waybar
|
||||
# Determine the icon
|
||||
if [ -n "$bt_connected" ]; then
|
||||
echo ""
|
||||
icon=""
|
||||
else
|
||||
echo ""
|
||||
icon=""
|
||||
fi
|
||||
# Tooltip: connected device names
|
||||
echo "$bt_connected"
|
||||
# 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: .}'
|
||||
#+END_SRC
|
||||
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
"tooltip": true,
|
||||
"tooltip-format": "Connected devices:\n{output}",
|
||||
"on-click": "blueman-manager"
|
||||
}
|
||||
},
|
||||
|
||||
"cpu": {
|
||||
"format": "{usage}% ",
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Get connected devices
|
||||
# Collect connected devices
|
||||
bt_connected=$(bluetoothctl devices | while read -r line; do
|
||||
mac=$(echo "$line" | awk '{print $2}')
|
||||
state=$(bluetoothctl info "$mac" | grep "Connected" | awk '{print $2}')
|
||||
if [ "$state" = "yes" ]; then
|
||||
name=$(echo "$line" | cut -d' ' -f3-)
|
||||
echo "$name"
|
||||
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
||||
echo "$line" | cut -d' ' -f3-
|
||||
fi
|
||||
done)
|
||||
# Main icon for Waybar
|
||||
# Determine the icon
|
||||
if [ -n "$bt_connected" ]; then
|
||||
echo ""
|
||||
icon=""
|
||||
else
|
||||
echo ""
|
||||
icon=""
|
||||
fi
|
||||
# Tooltip: connected device names
|
||||
echo "$bt_connected"
|
||||
# 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: .}'
|
||||
|
||||
Reference in New Issue
Block a user