Linux: xkb Tutorial

By Xah Lee. Date: . Last updated: .

this page is work in progress. Ignore it.

xkb X Keyboard Extension

xkb (X Keyboard Extension) is a more capable system to set keys in X11, than xmodmap.

setxkbmap → set the keyboard using the X Keyboard Extension.

# set layout to us
setxkbmap -layout us
# set layout to US dvorak
setxkbmap -layout us -variant dvorak
# setxkbmap example, set to US, Dvorak, and swap Ctrl Caps
setxkbmap -layout us -variant dvorak -option ctrl:swapcaps
# reset all custom keymap to default
setxkbmap -option

How to find xkb key notation?

look at:

setxkbmap ctrl:nocaps

man setxkbmap man xkeyboard-config

#clear xkb cache
sudo rm -rf /var/lib/xkb/


[XKB tutorial By Doug Palmer. At , accessed on 2017-01-09 ]

[A simple, humble but comprehensive guide to XKB for linux By Damiano Venturin. At , accessed on 2016-06-17 ]