Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to set a secondary keyboard shortcut for a certain action (say, "Volume up")?

share|improve this question
    
Can you specify version of Ubuntu and type of session (unity, gnome-shell, gnome classic/fallback)? –  enzotib Jan 4 '12 at 21:37
    
Using Gnome 3 fallback, but I guess other people would find useful other variants as well. –  Mladen Jablanović Jan 5 '12 at 20:20

1 Answer 1

You can do that with xdotool. Just create a new shortcut with the command
xdotool key --clearmodifiers XF86AudioRaiseVolume to raise or
xdotool key --clearmodifiers XF86AudioLowerVolume to lower.

Step by step instructions:
1) Install xdotool.
2) Open the shortcut manager (on 11.10 and later: Alt + F2 and paste gnome-control-center keyboard)
3) Choose the tab "Shortcuts"
4) Choose "Custom Shortcuts"
5) Click on "+" like in this picture:

enter image description here

6) At "Name:" paste vol.
7) At "Command:" paste xdotool key --clearmodifiers XF86AudioLowerVolume:

enter image description here

8) Close the dialog.
9) Click at "Disabled" and make your shortcut.

enter image description here

10) Enjoy ;-)

share|improve this answer
    
Thanks, this workaround works. Does this mean there is no support for secondary combinations in Gnome? BTW, funny thing, there is no notification sound when changing volume using this method (and using standard volume keys result causes it). –  Mladen Jablanović Jan 5 '12 at 20:29
    
That is funny because I got the notification. I don't know for sure (because I'm often surprised by someone), but I couldn't find any support for secondary combinations in Gnome. Best regards. –  desgua Jan 5 '12 at 22:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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