I got this far (from .bashrc
):
alias i="amixer -c 0 -- sset Master playback +1dB"
alias d="amixer -c 0 -- sset Master playback -1dB"
alias v4="amixer -c 0 -- sset Master playback 40%"
alias v8="amixer -c 0 -- sset Master playback 80%"
The first two rows should work, if I read the man amixer
page correctly, and they don't produce an error message, but their behavior is unreliable: sometimes there's a huge change, most often nothing happens.
The last two rows work. I guess you could make like ten aliases. Still, you would like the increase/decrease functionality to bind to keyboard shortcuts.
Am I using amixer
the wrong way or is there some other tool to do the trick? (alsamixer
doesn't seem to have this functionality as CLI commands.)
Edit
At last, made it work. This was so long ago (how sad!), so I have lost track of who contributed what. Anyway, thanks. (Below: For bash users, put in .bashrc
)
# volume
alias vol="alsamixer"
MASTER="amixer -q -c 0 sset Master playback"
alias i="$MASTER 2dB+"
alias d="$MASTER 2dB-"
alias mute="echo \" Audio muted.\"; $MASTER mute"
alias play="echo \" Audio un-muted.\"; $MASTER unmute"
alias unmute="play"
alias stop="mute"
v () {
amixer -q sset Master playback $1%
}