Bind a key in Linux to Increase/Decrease the Volume

Using these instructions I was able to set Shift + Page Up to increase the volume, and Shift + Page Down to decrease the volume. These instructions are for Ubuntu 13.04 with XFCE but should work with Unity or other distributions. The code below also works if you want to control the volume via a shell script or program.

Open the Keyboard control panel and choose the Keyboard Shortcuts tab

Click Add

Enter the command:

amixer -D pulse sset Master 5%-

Press OK, then it will ask you to type the desired keyboard shortcut. I pressed Shift + Page Down.

Create another one, this time enter for Volume Up:

amixer -D pulse sset Master 5%+

And then press another shortcut, I used Shift + Page Up.