Skip to content

Instantly share code, notes, and snippets.

@trevor-atlas
Created July 26, 2019 12:59
Show Gist options
  • Save trevor-atlas/93cd25d534047b18b90d1ad905418210 to your computer and use it in GitHub Desktop.
Save trevor-atlas/93cd25d534047b18b90d1ad905418210 to your computer and use it in GitHub Desktop.
How to map the Caps Lock key to Escape key
  1. Use setxkbmap to remap the key (does not require a daemon and is independent of your desktop environment or window manager). Don't forget to add the command before the exec gnome-session (or similar) line in your ~/.xinitrc or ~/.xsession:
setxkbmap -option caps:escape

setxkbmap can be found in package extra/xorg-setxkbmap.

  1. dconf-editor → org.gnome.desktop.input-sources.xkb-options → Add caps:escape to the aforementioned field.
  2. gnome-session-settings → Startup Programs → Add → Name=Remap caps lock to escape, command=setxkbmap -option caps:escape

FYI, I obtained the XKB rule by grepping /usr/share/X11/xkb/rules for caps and esc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment