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, "interval": 5,
"on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect", "on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect",
"on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh disconnect", "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": { "custom/audio-output": {
"format": "{}", "format": "{}",

View File

@@ -71,16 +71,22 @@ if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
# Handle click actions passed from Waybar. # Handle click actions passed from Waybar.
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)
if [[ "$current_mode" == "active" ]]; then next_mode=""
pbpctrl set anc aware case "$current_mode" in
else active)
pbpctrl set anc active next_mode="aware"
fi ;;
sleep 0.1 aware)
;; next_mode="off"
toggle_anc_off) ;;
pbpctrl set anc off off)
next_mode="active"
;;
esac
pbpctrl set anc "$next_mode"
sleep 0.1 sleep 0.1
;; ;;
connect) connect)