Use pactl to control muting/unmuting for compatibility.

This commit is contained in:
Sheldon Lee 2022-09-21 00:14:41 +08:00
parent 1ff55c976f
commit 3ed6dd158b

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
amixer set Capture toggle @> /dev/null
str=$(grep '\[on\]\|\[off\]' <<< $(amixer get Capture) | awk '{print $5}') pactl set-source-mute @DEFAULT_SOURCE@ toggle
echo $str str=$(pactl get-source-mute @DEFAULT_SOURCE@| awk '{print $2}')
notify-send "Microphone: $str"
[[ "$str" == "yes" ]] && notify-send "Microphone: off"
[[ "$str" == "no" ]] && notify-send "Microphone: on"