Mapping Caps Lock to ESC in XFCE

I prefer the Caps Lock key over ESC because the travel to that key is shorter.

To map Caps Lock to ESC add the following to a script and ensure it executes shortly after logging into X.

#!/bin/sh
/usr/local/bin/xmodmap -e "clear Lock"
/usr/local/bin/xmodmap -e "keysym Caps_Lock = Escape"

In my case, I use XFCE so I auto start it by adding /home/<user>/bin/capsToEsc.sh under Settings -> Session and Startup -> Application Autostart -> Add -> Command.

Leave a Reply