fixed the pixelbuds script
This commit is contained in:
@@ -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": "{}",
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user