Tag: sound

Mute

by rullzer on Oct.17, 2007, under Hardware, Linux

So I just compiled warsow. Since I wanted a nice FPS to play with my friends. Ah well anyway. When I was in full screen I noticed that I wasn’t able to change the volume of the sound. So I spend some time playing with acpid to get it to react to my FN keys. Well that all worked. Getting the volume up and down was easy. Thanks to the nice program amixer. However toggeling the mute took some time to figure out. Well not the muting and unmuting itself that was easy. But to toggle it. So I ended up writing a simple bash script:

#!/bin/bash
numid="2" #Find by running amixer controls
volume=$(amixer cget numid=$numid | grep :)
volume=${volume: -3}
if [[ $volume = 'off' ]]
then
amixer cset numid=$numid on &> /dev/null
else
amixer cset numid=$numid off &> /dev/null
fi

Maybe it is of good use for you to :)

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!