Shell script for volume control

The base of the Linux sound software stack is formed by ALSA, the Advanced Linux Sound Architecture, with these days normally a midlevel layer on top in the form of Pulseaudio; you can arrange for volume adjustment at both levels; should preferably do so at the Pulseaudio one.

Pulseaudio makes available the pactl tool, which you can use in the form of, say,

pactl set-sink-volume 0 0
pactl set-sink-volume 0 50%
pactl set-sink-volume 0 +10%
pactl set-sink-volume 0 -10%

In Mint 17.3 pactl has a bug that necessitates writing that last example as pactl -- set-sink-volume 0 -10% instead; would not know if the Mint 18 version still has the issue; see The first 0 in those commands specifies the sink, the sound card, and is automatically correct if you have only one card installed. Otherwise decide which sink to use from the output of pactl list sinks. Use man pactl for further information.

At the ALSA level you have available the amixer command line mixer. For example,

amixer set Master 0
amixer set Master 50%
amixer set Master 10%+
amixer set Master 10%-

In this, not specifying a card number with -c <number> means card 0; if not, use aplay -l to identify the number. “Master” is the name of a generally available control; you can list available controls with amixer scontrols and learn more from man amixer.

If you are not specifying correct sink for pactl or card/device/control for amixer please see your outputs of pactl list sinks and aplay -l.