Posts // Remap Caps Lock to CTRL in i3 Using setxkbmap

How to remap the Caps Lock key to CTRL in the i3 window manager using setxkbmap

Problems with i3 and xmodmap

I wrote a blog post a few months ago on my xmodmap configuration for remapping Caps Lock to CTRL. After an Arch update xmodmap mysteriously stopped working. I don't know why. I hate unknowns, but I never had time to figure it out. My muscle memory is very reliant on Caps Lock being CTRL so I changed my configuration to use setxkbmap.

Configuring i3 to Automatically run setxkbmap

Here is the code I added to the bottom of my i3 configuration file:

# Remap Caps Lock to CTRL
exec --no-startup-id /usr/bin/setxkbmap -option "ctrl:nocaps"

This will automatically remap the Caps Lock key to CTRL whenever you login to i3.

More Ranting on the Caps Lock key

I ranted a bit on the archaic nature of the Caps Lock key in my prior blog post on xmodmap. I guess I wasn't done?

How many times have you used the Caps Lock key? I can count the number of times on one hand by bringing my thumb to my index finger. Zero times. I am going to make a guess that back in the good-ol'-days, back when streams were made of honey and cans were made for kicking, people used the Caps Lock key because it was tiring to hold down the Shift key to uppercase a large portion of text on a manual typewriter. Over the years I have rifled through boxes of old documents and noticed that many old forms were typed in uppercase. I assume this was a beauracratic standard for consistency and legibility. The Caps Lock key made sense. It was an early ergonomic invention that saved many awkward pinky movements.

Times have changed. Those streams of honey are now recognized as toxic waste leaking from an upstream factory and kicking tin cans has been replaced with drop kicking your game controller after losing another round with a Dark Souls boss. The Caps Lock key takes up easily accessible keyboard real estate. It is valuable and should be used more frequently.

Rant over? Stay tuned!

Related Posts