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": true,
|
||||||
"tooltip-format": "Connected devices:\n{output}",
|
"tooltip-format": "Connected devices:\n{output}",
|
||||||
"on-click": "blueman-manager"
|
"on-click": "blueman-manager"
|
||||||
}
|
},
|
||||||
|
|
||||||
"cpu": {
|
"cpu": {
|
||||||
"format": "{usage}% ",
|
"format": "{usage}% ",
|
||||||
@@ -2988,23 +2988,23 @@ 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
|
||||||
# Get 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}')
|
||||||
state=$(bluetoothctl info "$mac" | grep "Connected" | awk '{print $2}')
|
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
||||||
if [ "$state" = "yes" ]; then
|
echo "$line" | cut -d' ' -f3-
|
||||||
name=$(echo "$line" | cut -d' ' -f3-)
|
|
||||||
echo "$name"
|
|
||||||
fi
|
fi
|
||||||
done)
|
done)
|
||||||
# Main icon for Waybar
|
# Determine the icon
|
||||||
if [ -n "$bt_connected" ]; then
|
if [ -n "$bt_connected" ]; then
|
||||||
echo ""
|
icon=""
|
||||||
else
|
else
|
||||||
echo ""
|
icon=""
|
||||||
fi
|
fi
|
||||||
# Tooltip: connected device names
|
# Output: main icon for Waybar, then connected devices for tooltip
|
||||||
echo "$bt_connected"
|
echo -n "$icon"
|
||||||
|
# Pass connected device names as JSON output for Waybar tooltip
|
||||||
|
echo "$bt_connected" | jq -R -s '{output: .}'
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "Connected devices:\n{output}",
|
"tooltip-format": "Connected devices:\n{output}",
|
||||||
"on-click": "blueman-manager"
|
"on-click": "blueman-manager"
|
||||||
}
|
},
|
||||||
|
|
||||||
"cpu": {
|
"cpu": {
|
||||||
"format": "{usage}% ",
|
"format": "{usage}% ",
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Get 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}')
|
||||||
state=$(bluetoothctl info "$mac" | grep "Connected" | awk '{print $2}')
|
if [ "$(bluetoothctl info "$mac" | awk '/Connected:/ {print $2}')" = "yes" ]; then
|
||||||
if [ "$state" = "yes" ]; then
|
echo "$line" | cut -d' ' -f3-
|
||||||
name=$(echo "$line" | cut -d' ' -f3-)
|
|
||||||
echo "$name"
|
|
||||||
fi
|
fi
|
||||||
done)
|
done)
|
||||||
# Main icon for Waybar
|
# Determine the icon
|
||||||
if [ -n "$bt_connected" ]; then
|
if [ -n "$bt_connected" ]; then
|
||||||
echo ""
|
icon=""
|
||||||
else
|
else
|
||||||
echo ""
|
icon=""
|
||||||
fi
|
fi
|
||||||
# Tooltip: connected device names
|
# Output: main icon for Waybar, then connected devices for tooltip
|
||||||
echo "$bt_connected"
|
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