fixed buds script

This commit is contained in:
2025-08-15 18:06:04 +02:00
parent b81c6e2228
commit 52cc37a102
3 changed files with 27 additions and 12 deletions

View File

@@ -10,7 +10,7 @@
"custom/bluetooth-audio", "custom/bluetooth-audio",
"custom/pixelbuds_pro", "custom/pixelbuds_pro",
"wireplumber", "wireplumber",
"custom/audio-output", // "custom/audio-output",
"network", "network",
"cpu", "cpu",
"memory", "memory",
@@ -55,13 +55,14 @@
}, },
"wireplumber": { "wireplumber": {
"format": "{volume}% {icon}", "format": "{volume}% {icon}",
"format-muted": "Muted ", "format-muted": "{node_name} ",
"format-icons": { "format-icons": {
"headphone": "", "headphone": "",
"hands-free": "", "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 "scroll-step": 1
}, },
@@ -161,7 +162,7 @@
"custom/bluetooth-audio", "custom/bluetooth-audio",
// "custom/pixelbuds_pro", // "custom/pixelbuds_pro",
"wireplumber", "wireplumber",
"custom/audio-output", // "custom/audio-output",
"network", "network",
"cpu", "cpu",
"memory", "memory",
@@ -206,16 +207,16 @@
}, },
"wireplumber": { "wireplumber": {
"format": "{volume}% {icon}", "format": "{volume}% {icon}",
"format-muted": "Muted ", "format-muted": "{node_name} ",
"format-icons": { "format-icons": {
"headphone": "", "headphone": "",
"hands-free": "", "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 "scroll-step": 1
}, },
"custom/bluetooth-audio": { "custom/bluetooth-audio": {
"format": "{}", "format": "{}",
"return-type": "json", "return-type": "json",

View File

@@ -84,7 +84,7 @@ status() {
case "$1" in case "$1" in
cycle_anc) cycle_anc)
current_mode=$(pbpctrl get anc 2>/dev/null) current_mode=$(pbpctrl get anc 2>/dev/null)
next_mode="" next_mode="active"
case "$current_mode" in case "$current_mode" in
active) active)
next_mode="aware" next_mode="aware"
@@ -100,10 +100,18 @@ case "$1" in
sleep 0.1 sleep 0.1
;; ;;
connect) connect)
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 bluetoothctl connect "$MAC_ADDRESS" & disown
fi
;; ;;
disconnect) disconnect)
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
bluetoothctl disconnect "$MAC_ADDRESS" & disown bluetoothctl disconnect "$MAC_ADDRESS" & disown
else
notify-send "Pixel Buds Pro 2 aren't connected"
fi
;; ;;
*) *)
status status

View File

@@ -77,6 +77,12 @@ window#waybar.hidden {
color: @text; color: @text;
} }
#wireplumber.muted, #custom-pixelbuds_pro {
background-color: @base;
color: @subtext1;
border-bottom: 3px solid @subtext1;
}
#custom-pixelbuds_pro.anc-active { #custom-pixelbuds_pro.anc-active {
color: @sapphire; color: @sapphire;
border-bottom: 3px solid @sapphire; border-bottom: 3px solid @sapphire;