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:
parent
5ce6111f51
commit
59a2d5084a
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue