xmodmap

xmodmap
1
is a utility for modifying keymaps and pointer button mappings in
X
2
.


A. Setup

IMPORTANT

  • Only write a single keysym
    • e.g. Escape instead of Escape NoSymbol Escape
    • e.g. Alt_R Meta_R instead of Alt_R Meta_R Alt_R Meta_R
  • Do not write NoSymbol
  • Do not write hex or comma
    • e.g. (0x32) or , from modifier keys

NOTE

  • A custom table is written in a keymap file
    • e.g. .Xmodmap which is the conventional filename for keymap file
    • It is loaded from /etc/X11/xinit/xinitrc in i3 during log in
  • Activate keymap file with xmodmap
    • e.g. xmodmap ~/.Xmodmap
  • Verify keys to be remapped with
    xev
    3
  • List modifier keys with xmodmap -pm

B. Reset

NOTE

  • setxkbmap
    4
    (re)sets keyboard using X Keyboard Extension
  • xmodmap -pke prints keymap table as expressions

References

Show Comments