0

My keyboard has a volume dial on it, and by default that dial triggers an "Audio raise volume" action (that's what the shortcut is called in the Keyboard Shortcuts dialog) when I turn it up. However, that only raises the volume to 100%, and I want the volume dial to go up to 150% (which I can do in the Sound Preferences dialog, just not via the keyboard volume dial).

I found the command for raising the volume at the command line: pactl set-sink-volume @DEFAULT_SINK@ +10% (or -10% to lower it). However, I can't figure out how to set the "Volume down/up" key handlers (in Keyboard Shortcuts) to that command. It seems like I can only set them to specific keystrokes ... in fact, I seem to have accidentally disabled their default "Audio raise/lower volume" actions just by trying to change them, as there doesn't even seem to be a way to restore their default actions (let alone set a custom command) once you've changed them from the defaults.

But surely there must be a way to specify that a "Audio raise volume" keystroke triggers pactl set-sink-volume @DEFAULT_SINK@ +10% ... right?

EDIT: I found another way to change the keyboard bindings, by installing dconf-tools and then using dconf-editor to edit the values in org.mate.SettingsDaemon.plugins.media-keys. However, I have the same issue with this tool: I can see how to make the binding invoke keystrokes, and I can see how to make it trigger "actions" like XF86AudioRaiseVolume ... but I can't figure out how to trigger pactl set-sink-volume @DEFAULT_SINK@ +10%.

2
  • 1
    Disable whatever currently intercepts the volume dial events, use xev to verify it generates XF86AudioLowerVolume and XF86AudioRaiseVolume keysyms, re-bind those events to custom commands in your window manager, xbindkeys, or whatever your desktop environment provides.
    – dirkt
    Dec 17, 2017 at 9:33
  • Thanks for the response, but I would love a full answer with more details, as I'm not sure how to "disable whatever currently intercepts the volume dial events" (AFAIK it's MATE itself, because I configure the "interception" in the MATE Keyboard Shortcuts dialog), or how to use xev. or whether I should use xbindkeys or something else (I'm on Linux Mint, MATE edition if that helps). Dec 17, 2017 at 16:50

1 Answer 1

1

I finally figured it out, and the solution didn't even require anything as low-level as dconf-editor: you can solve the whole problem just in Keyboard Shortcuts.

What confused me was that Keyboard Shortcuts maps actions => keyboard shortcuts, not the other way around (which, personally, would seem far more logical to me). This means changing Volume Up/Down doesn't change what happens when you turn the volume up/down on the keyboard, it just changes which keyboard shortcut triggers the standard volume up/down action.

What I really wanted to do was the following:

  1. Create an entirely new action by clicking on the "Add" button at the bottom of Keyboard Shortcuts
  2. Name the new action (I went with "Raise Volume 10% (up to 150%)" and "Lower Volume 10% (from up to 150%)" for my two actions). EDIT: It turns out that command actually goes beyond just 150%, so the name I chose was inaccurate. The sound quality deteriorates fairly quickly after 150% though, so that's sort of a practical limit.
  3. Set the new action (for me this was pactl set-sink-volume @DEFAULT_SINK@ +10% and pactl set-sink-volume @DEFAULT_SINK@ -10%)
  4. Click Apply to create the new action
  5. Click on the "Shortcut" column for the new action, and the column will change to "New Shortcut ...".
  6. Hit whatever key you want to bind the action to (for me this meant turning my volume knob up/down), and that will bind that key to the new action

If you repeat the above for both raising and lowering the volume you can finally have your volume dial turn the volume up all the way to "150%" ... or trigger any other action from your volume dial (or any other key)!

P.S. There is a downside to switching your volume knob to the new command: it doesn't show the volume overlay. For this reason I found it was better to leave the volume knob on its default binding, and instead bound SHIFT + *Volume Up/Down* to the command. This let me use the volume dial normally when I only wanted volume up to 100%, and then when I really want to "crank it up" I can just hold down shift.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.