From 6e647070d88319c087caab1acd944d7f78d619e2 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Fri, 15 Aug 2025 21:13:36 +0200 Subject: [PATCH] i have to rework the bar... too full --- waybar/config.jsonc | 12 ++++++------ waybar/scripts/bluetooth_audio.sh | 2 +- waybar/scripts/pixelbuds_pro_control.sh | 15 +++++++++++---- waybar/style.css | 6 +----- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/waybar/config.jsonc b/waybar/config.jsonc index ae19991..1ce5a0d 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -2,13 +2,12 @@ { "layer": "top", "position": "top", - "height": 40, + "height": 50, "modules-left": ["hyprland/workspaces"], "modules-center": [], "modules-right": [ "custom/bluetooth-audio", "custom/pixelbuds_pro", - "wireplumber", "network", "cpu", "memory", @@ -16,6 +15,7 @@ "custom/gpu-screen-recorder", "custom/gamemode", "tray", + "wireplumber", "clock" ], @@ -54,8 +54,8 @@ "tooltip-format": "{ifname} via {gwaddr}" }, "wireplumber": { - "format": "{volume}% {icon}", - "format-muted": "--- ", + "format": "{volume}% {icon}", + "format-muted": "{node_name} ", "format-icons": { "headphone": "", "hands-free": "", @@ -121,8 +121,8 @@ "return-type": "json", "exec": "~/.config/waybar/scripts/pixelbuds_pro_control.sh", "interval": 5, - "on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect", - "on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc" + "on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect", + "on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc" }, "custom/audio-output": { "format": "{}", diff --git a/waybar/scripts/bluetooth_audio.sh b/waybar/scripts/bluetooth_audio.sh index be0f779..aa5c171 100755 --- a/waybar/scripts/bluetooth_audio.sh +++ b/waybar/scripts/bluetooth_audio.sh @@ -109,7 +109,7 @@ if [ -n "$device_mac" ]; then device_name=$(bluetoothctl info "$device_mac" | rg "Alias:" | cut -d ' ' -f 2-) # Output in Waybar's JSON format tooltip=$(bt-audio-info $device_mac) - echo "{\"text\": \"$device_name 󰂰\", \"tooltip\": \"$tooltip\"}" + echo "{\"text\": \"$device_name 󰂰\", \"tooltip\": \"$tooltip\"}" else # Output empty string when no device is connected echo "{}" diff --git a/waybar/scripts/pixelbuds_pro_control.sh b/waybar/scripts/pixelbuds_pro_control.sh index 0abfe3b..7bbaa06 100755 --- a/waybar/scripts/pixelbuds_pro_control.sh +++ b/waybar/scripts/pixelbuds_pro_control.sh @@ -7,7 +7,7 @@ MAC_ADDRESS="B4:23:A2:09:D3:53" not_connected() { printf "{\"text\": \"\", \"tooltip\": \"Pixel Buds Pro 2 not connected\", \"class\": \"disconnected\"}\n" - exit 0 + exit } # This function gets the current status and formats it for Waybar. @@ -27,7 +27,7 @@ get_status() { if ([[ "$left_bud" == "unknown" ]] && [[ "$right_bud" == "unknown" ]]) || \ [[ -z "$left_bud" && -z "$right_bud" ]]; then echo "{}" - exit 0 + exit fi if [[ "$left_bud" == "unknown" ]]; then @@ -67,6 +67,7 @@ get_status() { # --- FORMAT OUTPUT --- printf '{"text": "%s | %s | %s", "tooltip": "Pixel Buds Pro 2", "class": "%s"}\n' \ "$left_display" "$right_display" "$anc_icon" "$class" + exit } status() { @@ -98,22 +99,28 @@ case "$1" in esac pbpctrl set anc "$next_mode" sleep 0.1 + exit ;; connect) if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then notify-send "Pixel Buds Pro 2 are already connected" + exit else - bluetoothctl connect "$MAC_ADDRESS" & disown + bluetoothctl connect "$MAC_ADDRESS" + exit fi ;; disconnect) if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then - bluetoothctl disconnect "$MAC_ADDRESS" & disown + bluetoothctl disconnect "$MAC_ADDRESS" + exit else notify-send "Pixel Buds Pro 2 aren't connected" + exit fi ;; *) status + exit ;; esac diff --git a/waybar/style.css b/waybar/style.css index a563482..6239226 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -189,7 +189,7 @@ window#waybar.hidden { padding-right: 15px; } -#custom-audio-output, #wireplumber { +#clock, #custom-audio-output, #wireplumber { color: @teal; border-bottom: 3px solid @teal; } @@ -198,10 +198,6 @@ window#waybar.hidden { padding-right: 15px; } -#clock { - color: @teal; -} - tooltip { border-radius: 8px; padding: 15px;