blog + microblog + linkblog + site updates + contact + about me + RSS

writer13's webspace

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. :)

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

In case you are wondering: 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 and some CSS (plus some custom fonts). Hosted on Neocities and created with Emacs.

parasurv.neocities.org 2018-2022 - writer13.neocities.org 2022-