scripts: Fix unmuting in control-volume amixer

amixer mutes all individual output streams when it mutes (master,
speaker, headphone) but only unmutes master by default.
This is a simple fix to unmute everything when we do.
This commit is contained in:
Marty Oehme 2021-03-19 09:12:15 +01:00
parent 5ce6111f51
commit 59a2d5084a
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -31,13 +31,18 @@ set_volume() {
# set mute state (off=mute) # set mute state (off=mute)
set_mute() { set_mute() {
[ "$(get_mute)" = "on" ] && toggleto=off || toggleto=on
if [ "$1" = 'off' ]; then if [ "$1" = 'off' ]; then
amixer_quiet set Master mute amixer_quiet set Master mute
elif [ "$1" = 'on' ]; then elif [ "$1" = 'on' ]; then
amixer_quiet set Master unmute amixer_quiet set Master unmute
# the following is needed, see https://superuser.com/questions/805525/why-is-unmute-not-working-with-amixer-command
amixer_quiet set Speaker unmute
amixer_quiet set Headphone unmute
else else
[ "$(get_mute)" = "on" ] && newm=off || newm=on amixer_quiet set Master "$toggleto"
amixer_quiet set Master "$newm" amixer_quiet set Speaker "$toggleto"
amixer_quiet set Headphone "$toggleto"
fi fi
} }