Skip to content

Instantly share code, notes, and snippets.

@justinmklam
Last active August 21, 2022 20:41
Show Gist options
  • Save justinmklam/e5f540b350289f8d263c9bbad3436212 to your computer and use it in GitHub Desktop.
Save justinmklam/e5f540b350289f8d263c9bbad3436212 to your computer and use it in GitHub Desktop.
Remap capslock to ctrl when held, escape when pressed (for Linux). Source: https://wiki.archlinux.org/title/Xorg/Keyboard_configuration#Swapping_Caps_Lock_with_Left_Control
# Install xcape (https://github.com/alols/xcape)
sudo pacman -S xcape
# Add the following to ~/.xprofile so they're executed at startup (since these commands don't persist across sessions)
setxkbmap -option caps:ctrl_modifier # Set capslock to ctrl when held
xcape -e 'Caps_Lock=Escape' # Set capslock to escape when pressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment