I'm trying to set up a hardware mute button for my notebook running chrunchbang linux, I've got the key event handling working and pointing to a script like this :
curvol=$(amixer get Master | grep 'off')
if ["$curvol" != ""]
then
amixer set Master unmute
else
amixer set Master mute
fi
what happens is on pressing the button assigned, it will unmute if muted; but it won't mute if it isn't already muted.
I think the problem is in the if statement where I check for output from the command; it seems to be always doing the unmute, regardless of whether the if returns true or not.
Any help would be greatly appreciated! Thanks in advance.
$curvolis what you expect?[command/operator and the]token