diff --git a/waybar/config.jsonc b/waybar/config.jsonc index 0c18ade..c181bc2 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -10,7 +10,7 @@ "custom/bluetooth-audio", "custom/pixelbuds_pro", "wireplumber", - "custom/audio-output", + // "custom/audio-output", "network", "cpu", "memory", @@ -55,13 +55,14 @@ }, "wireplumber": { "format": "{volume}% {icon}", - "format-muted": "Muted ", + "format-muted": "{node_name} ", "format-icons": { "headphone": "", "hands-free": "", - "default": ["", ""] + "default": ["", "", ""] }, - "on-click": "pavucontrol", + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", + "on-click-right": "~/.config/waybar/scripts/cycle_audio_output.sh", "scroll-step": 1 }, @@ -161,7 +162,7 @@ "custom/bluetooth-audio", // "custom/pixelbuds_pro", "wireplumber", - "custom/audio-output", + // "custom/audio-output", "network", "cpu", "memory", @@ -206,16 +207,16 @@ }, "wireplumber": { "format": "{volume}% {icon}", - "format-muted": "Muted ", + "format-muted": "{node_name} ", "format-icons": { "headphone": "", "hands-free": "", - "default": ["", ""] + "default": ["", "", ""] }, - "on-click": "pavucontrol", + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", + "on-click-right": "~/.config/waybar/scripts/cycle_audio_output.sh", "scroll-step": 1 }, - "custom/bluetooth-audio": { "format": "{}", "return-type": "json", diff --git a/waybar/scripts/pixelbuds_pro_control.sh b/waybar/scripts/pixelbuds_pro_control.sh index fe32dfd..7ff0a50 100755 --- a/waybar/scripts/pixelbuds_pro_control.sh +++ b/waybar/scripts/pixelbuds_pro_control.sh @@ -84,7 +84,7 @@ status() { case "$1" in cycle_anc) current_mode=$(pbpctrl get anc 2>/dev/null) - next_mode="" + next_mode="active" case "$current_mode" in active) next_mode="aware" @@ -100,10 +100,18 @@ case "$1" in sleep 0.1 ;; connect) - bluetoothctl connect "$MAC_ADDRESS" & disown + if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then + notify-send "Pixel Buds Pro 2 are already connected" + else + bluetoothctl connect "$MAC_ADDRESS" & disown + fi ;; disconnect) - bluetoothctl disconnect "$MAC_ADDRESS" & disown + if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then + bluetoothctl disconnect "$MAC_ADDRESS" & disown + else + notify-send "Pixel Buds Pro 2 aren't connected" + fi ;; *) status diff --git a/waybar/style.css b/waybar/style.css index aa5da12..839eaba 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -77,6 +77,12 @@ window#waybar.hidden { color: @text; } +#wireplumber.muted, #custom-pixelbuds_pro { + background-color: @base; + color: @subtext1; + border-bottom: 3px solid @subtext1; +} + #custom-pixelbuds_pro.anc-active { color: @sapphire; border-bottom: 3px solid @sapphire;