Ubuntu – How to set a custom keyboard shortcut to control volume

12.04shortcut-keysunityvolume-control

I would like to be able to set three custom keyboard shortcuts to be able to decrease, increase and mute the volume in Ubuntu 12.04 (Unity). On my old Ubuntu 10.04 (Gnome) system I made CTRL + [, CTRL + ] and CTRL + \ my commands to achieve this.

What is the simplest way to go about this?

Best Answer

@dobey's solution works if you want to have only one keyboard shortcut for increasing / decreasing the volume.

If instead you want to have multiple key bindings controlling the volume (like to keep the default volume buttons on your laptop working, while adding additional keyboard shortcuts to use when you connect an external keyboard that does not have volume controls), then:

  1. Go to System Settings → Keyboard → Shortcuts → Custom Shortcuts.

  2. Click + to add a new keyboard shortcut. Set the "Name" to Volume up, "Command" to

    amixer -D pulse sset Master 5%+ and click Apply.

  3. Click Disabled next to your new key and choose the desired binding on your keyboard.

  4. Add another shortcut with name Volume down and command

    amixer -D pulse sset Master 5%-

Steps GIF

Related Question