parasurv@webspace ~ $

Blog: [Site updates] [Linux] [Free Software] [Culture] [Health] [Watches] Learning: [Emacs Journal] [Linux Wiki] Personal: [Contact] [About me]

Shorts: [Microblog] [Linkblog] Important: [Read] [Watch] [Listen] Other pages: [Old games stuff]

How to switch left Alt and left Windows key in Linux?

This is a geeky stuff, but recently discovered that my left hand is become quiet uncomfortable with the left Windows key, which I use for program launching in i3. I also realized that switching the left Alt and left Windows key would be probably the best solution. I found a simple solution through Xmodmap, which I like because it's distro independent.

I added these lines to my ~/.Xmodmap files:

keycode 14 = Alt_L
keycode 93 = Super_L
remove Mod1 = Alt_L
remove Mod4 = Super_L
add Mod1 = Super_L
add Mod4 = Alt_L

The keycode means the position of the two keys in the keymap table. You can find this with the utility, called xev.

Then we remove the default Mod definition of the left Alt and Windows keys, and last we switch it.

Thanks to my nice keyboard, I will be able to switch the physical keys too. :)

Hosted on Neocities and created with Emacs, the world best text editor, operating system. This website doesn't track you. I don't use any javascript or other scripts. I don't store any information about the visitors. It's just pure old fashioned HTML. Some parts of the site is not up-to-date design wise. I may or may not update them in the future. I don't really support mobile stuff, but I bet if you disable the little CSS I have, you can read the site perfectly.