(SOLVED) Keyboard hotkey for sound volume

I am looking for a way to raise/lower the sound volume without having to mouse the indicator applet. Ubuntu Mate 18.04 LTS, Cupertino layout

I have already set System Settings > Keyboard Shortcuts > Volume down to Ctrl+Alt+Down and Volume up to Ctrl+Alt+Up, but the keys don’t seem to affect the volume.

I have set Ctrl+Alt+Right and Ctrl+Alt+Left to change workspaces without problem, so I don’t think it is a non-standard key code problem.

Thanks!
Charles Nix

What I did was this, which actually works kinda brilliantly, to my surprise:

Open Keyboard Shortcuts app and add two custom shortcuts:

Name: Volume Up (via amixer)
Command: amixer -q sset Master 3%+

Name: Volume Down (via amixer)
Command: amixer -q sset Master 3%-

I associate Volume Up with F3 and Volume Down with F2 personally (because these are the keys on my laptop that have those emblems), but of course it’s up to you which keys to use.

Thanks so much for the hints.

Quite mysteriously, my original settings in the post above, which I had abandoned and given up on, began working as expected today.

I can’t imagine what has changed: there have been several login/outs with no effect. Yesterday may have been the first full reboot because of the kernel release–but why would a keyboard shortcut need a reboot? I also see libasound2 package upgraded two days ago; maybe that was it.

Thanks for the help–as long as it is working now as expected, there is nothing to fix.

Charles Nix

1 Like

Note that my amixer workaround is no longer necessary for me here as of a month or two ago, and I can just reassign the Volume Up/Down actions in keyboard shortcuts to different keys and it works fine.

EDIT: I should note that "no longer necessary" should probably read "no longer works" for whatever reason.. amixer no longer controls the master slider.