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/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",

View File

@@ -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

View File

@@ -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;