So, answer the question first: To increase the Master volume level by 10%, consider this snippet:
amixer -q sset Master 10%+
You can also set it to a specific value:
amixer -q sset Master 78%
This can also be found in other answers, but I try to extend to the comment by Eric Leschinski, which basically is a TL:DR;-ish answer.
To read the Master Volume level (human readable), you can use:
amixer sget Master
To get the number in percent (from 0% to 100%), you can pipe it into grep
and awk
:
amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }'
On my notebook, I only have a mono-speaker, so the right code for me was:
amixer sget Master | grep 'Mono:' | awk -F'[][]' '{ print $2 }'
amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }'
Increase Master volume level by 10%:amixer -q sset Master 10%+