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.

I have two keyboards. One is built-in to my laptop, the other is an external keyboard I use when docked. They have slightly different key mappings for things like multimedia keys.

For that reason, I'd like to make multiple assignments to a handful of keyboard shortcuts. My external keyboard doesn't have a Windows button, so I'd like to launch Unity Dash (for example) using either a Windows/logo button, or to a specific keybinding.

Is there any way to make multiple assignments this way in Gnome?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can use xdotool to bind a shortcut to another shortcut:

1) Install xdotool.

2) Press Alt+F2 and paste gnome-control-center keyboard.

3) Go to the "Shortcuts" tab and then to "Custom shortcuts".

4) Press at "+" to add a new shortcut:

enter image description here

5) Give it a name and at the command you paste something like this:

gnome-terminal --geometry=0x0 -e "bash -c \"sleep .1 && xdotool keydown --clearmodifiers Super && xdotool keyup Super ; exit; exec bash\""

6) Press at "Disabled" and then press the key combination you want.

enter image description here

Enjoy ;-)

share|improve this answer
    
Any reason for the gnome-terminal part, instead of using xdotool directly? –  Ken Feb 22 '12 at 21:23
    
The reason is that oddly the gnome shortcuts doesn't execute commands, so we have to first open a terminal. –  desgua Feb 22 '12 at 23:41
    
askubuntu.com/questions/106754/… –  desgua Feb 22 '12 at 23:48
    
Weird how Gnome 2.x had an option to execute a command in a terminal or not. I guess that functionality was removed. –  Ken Feb 23 '12 at 16:52
add comment

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.