X11 Cheat Sheet
Getting key codes
Simple run xev
in a terminal, focus the window and press the key. Key codes will be given on stdout.
Print active keyboard layout
setxkbmap de -print | xkbcomp - - | xkbprint -color -o - - | ps2pdf - >layout.pdf
See xkbprint
options to print Alt, AltGr, Ctrl layout levels.
Change keyboard mappings
setxkbmap -query # show current mapping
setxkbmap -option "ctrl:swap_lalt_lctl" # swap 2 keys
setxkbmap -option "" # reset all mappings
Show current systemd based persistent mappings
localectl
Persist with systemd
localectl set-x11-keymap <options> # persist options as printed by 'setxkbmap -query'