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/

resource

[XKB tutorial By Doug Palmer. At http://www.charvolant.org/~doug/xkb/html/node5.html , accessed on 2017-01-09 ]

[A simple, humble but comprehensive guide to XKB for linux By Damiano Venturin. At https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450 , accessed on 2016-06-17 ]

https://wiki.archlinux.org/index.php/X_KeyBoard_extension

If you have a question, put $5 at patreon and message me.