Skip to content

Instantly share code, notes, and snippets.

@bootandy
Last active June 28, 2021 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bootandy/5d4fda05e37741f5ba3b0d3c1931910e to your computer and use it in GitHub Desktop.
Save bootandy/5d4fda05e37741f5ba3b0d3c1931910e to your computer and use it in GitHub Desktop.
Xmodmap: Swap Alt Ctrl keys, capslock AS control, shift-capslock as capslock.
! See keys with:
! xev
! Clear memory:
! setxkbmap -option
!
! Use this file:
! xmodmap ~/.Xmodmap
!
!setxkbmap -layout gb -option ctrl:nocaps
!xmodmap -e "keycode 9 = Caps_Lock NoSymbol Caps_Lock"
!xmodmap -e "keycode 66 = Escape NoSymbol Escape"
keycode 9 = Caps_Lock
keycode 66 = Escape
clear control
clear mod1
add control = Control_L Control_R
add mod1 = Alt_L
!add mod5 = Alt_R
! Make LeftAlt -> LeftControl
keycode 64 = Control_L
! Make LeftCtrl -> LeftAlt - you need the add and clears above for these to work
keycode 37 = Alt_L
! Make Alt-GR -> LeftAlt
!keycode 92 = Alt_L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment