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