fixed the pixelbuds script

This commit is contained in:
2025-08-15 11:10:22 +02:00
parent ac16d751ce
commit df361218f9
2 changed files with 16 additions and 9 deletions

View File

@@ -115,6 +115,7 @@
"interval": 5,
"on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect",
"on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh disconnect",
"on-click-middle": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc"
},
"custom/audio-output": {
"format": "{}",

View File

@@ -71,16 +71,22 @@ if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
# Handle click actions passed from Waybar.
case "$1" in
cycle_anc)
current_mode=$(pbpctrl get anc 2>/dev/null)
if [[ "$current_mode" == "active" ]]; then
pbpctrl set anc aware
else
pbpctrl set anc active
fi
sleep 0.1
next_mode=""
case "$current_mode" in
active)
next_mode="aware"
;;
toggle_anc_off)
pbpctrl set anc off
aware)
next_mode="off"
;;
off)
next_mode="active"
;;
esac
pbpctrl set anc "$next_mode"
sleep 0.1
;;
connect)