Skip Navigation

Remapping CapsLock to be the Compose key, and double-Shift to be the new CapsLock

If you type anything like I do, the CapsLock key gets very little use on your keyboard. Add the following lines to your i3 config file to remap it to be the Compose key, and use double-Shift as an alternate CapsLock for the infrequent occasions when it's needed:

 
    
# Remap CapsLock to Compose                                                      
exec setxkbmap -option compose:caps                                              
                                                                                 
# Both shift keys enable CapsLock and one shift key cancels it                   
exec setxkbmap -option shift:both_capslock_cancel    

  

This should work in most Linux distro. To find out if it will work in yours, type:

 
    
$ grep compose:caps /usr/share/X11/xkb/rules/base.lst
$ grep shift:both_capslock_cancel /usr/share/X11/xkb/rules/base.lst

  

If the combos are listed in base.lst, they will work.

There are other ways to remap CapsLock to Compose, but this one keeps everything nice and tidy in one config file.

3 comments