Friday, 18 May 2012

Need a Super key for Openbox?

This happened to me on Crunchbang Linux, but would for any desktop using Openbox. I had just installed Crunchbang on an old machine. When I started using the desktop I reached for the Super key (normally the Windows key) and found it missing. Oops, I have a very old keyboard on this machine. Openbox uses the Super key extensively. What to do?


The right Control key is seldom used so I decided to remap this to Super. A perusal of the xmodmap command showed the sequence of commands required.


First remove the control modifier from Control_R:


remove control = Control_R


Next assign it the mod4 qualifier, which is Super:


add mod4 = Control_R


Putting it all together in one command:


xmodmap -e 'remove control = Control_R' -e 'add mod4 = Control_R'


Put this command at the end of ~/.config/openbox/autostart.sh and it will be run at login.


Alternatively you can put those two commands in ~/.Xmodmap as described here. The step with keycode described on that page and many similar ones isn't necessary though.

No comments:

Post a Comment