amixer in ubuntu

If you want to change the volume in Ubuntu 11.10 it seems that amixer
is kind of bugged when it comes to toggle (mute/unmute). When
toggling Master, it also mutes all the separate groups (Front,
headphone, PCM and so on), but when toggled again it only unmutes
Master, which leaves the rest muted…

I came across a nice workaround that i wanted to share. The solution
was written by Jim Hunziker on this page:

1) Make a with the following content:

#!/bin/bash CURRENT_STATE=`amixer get Master | egrep 'Playback.*?[o' | egrep -o '[o.+]'|head -n 1`if [[ $CURRENT_STATE == '[on]' ]]; then    amixer set Master muteelse   amixer set Master unmute   amixer set Front unmute   amixer set Headphone unmute   amixer set PCM unmutefi

2) chmod u+x

3) Bind it to some key (f.ex. XF86AudioMute) to run



Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: