I came up with a solution to be able to control the volume of both your "Master" and "Line" using only your keyboard's "Media Keys".
First step is to disable your default volume controls by going into System → Preferences → Keyboard Shortcuts
, clicking the "Shortcuts" tab and setting Volume Up & Volume Down to "Disabled" on the "Sound and Media" page.
Secondly, you will need to assign your "Volume Keys" to custom commands on the "Custom Shortcuts" page. To do that, click on the "+" at the bottom to add a shortcut. Name the first command Volume Up
and have it execute a scripts: ./path-to-scripts/VolumeUp.sh
. Repeat this process for a second command and have it execute your VolumeDown.sh
script instead. Next, click on the command where it says "Disabled" and assign your key to it (repeat for both).
Finally, create your 2 scripts referred by the custom shortcuts and copy paste the following into them:
VolumeUp.sh:
#!/bin/bash
amixer -c0 -sq <<-EOF
set Master 10%+
set Line 10%+
EOF
VolumeDown.sh:
#!/bin/bash
amixer -c0 -sq <<-EOF
set Master 10%-
set Line 10%-
EOF
Don't forget to set your scripts as "Allow executing file as program" in the file properties or chmod
it to allow execution. You might also need to read up on amixer to know how much to modify the volume by (10% is just used as default).
If you open gnome-alsamixer, you should now see both "Master" and "Line" go up and down as you press your "Volume Keys". Only downside is the key, must be pressed and can't be held down to change the volume.