Mute/unmute mic alsamixer in commandline
June 14, 2009
The sound control on lxpanel only handles one channel. But let’s say I want to control mute/unmute on mic by a handy shortcut! Two handy scripts fixes this, which can be assigned to a keyboard shortcut in Openbox or your preferred WM/DE.
#!/bin/sh amixer set Mic 80% mute > /dev/null #!/bin/sh amixer set Mic 80% unmute > /dev/null
You may of course choose any other control you want – ie PCM:
amixer set PCM 10%+ > /dev/null
Will increase sound by 10%.
June 14, 2009 at 17:53
Oh yeah – the “> /dev/null” suppress the output to the terminal.
August 27, 2009 at 14:44
Thank you. I have been looking for this information for a couple days now. Once I knew I needed the amixer command, I read the manual page on it and discovered that this can be simplified further. Using the toggle parameter lets you do this with only one script or command:
#!/bin/bash
amixer set Mic 80% toggle > /dev/null
That makes setting up a keyboard shortcut even easier.