pactl
pactl command is used to control a running PulseAudio sound server.
Increase volume by 10%
pactl -- set-sink-volume 0 +10%
Decrease volume by 10%
pactl -- set-sink-volume 0 -10%
Set volume to 80%
pactl -- set-sink-volume 0 80%
Set volume to 200%
pactl -- set-sink-volume 0 200%
amixer
amixer is a command-line mixer for ALSA soundcard driver.
Increase volume by 10%
amixer set 'Master' 10%+
Decrease volume by 10%
amixer set 'Master' 10%-
Set volume to 10%
amixer set 'Master' 10%
Set volume to 80%
amixer set 'Master' 80%
Shows a complete list of simple mixer controls
amixer scontrols
Keyboard mapping
One can set “Super & +” key to increase volume and “Super & -“ key to decrease volume. The following steps will create shortcut keys to increase and decrease volume by 2%.
- Go to Settings Manager
- Go to Hardware -> Keyboard
- Go to ‘Application Shortcuts’ tab
- Click ‘Add’ button
- Write the command:
amixer set Master 2%-
- Type Super and – (minus) key
- Again click ‘Add’ button
- Write the command:
amixer set Master 2%+
- Type Super and + (plus) key
Original source: http://blog.chapagain.com.np/ubuntu-linux-increase-decrease-volume-from-command-line-keyboard-shortcut/