Linux: xkb Tutorial

By Xah Lee. Date: . Last updated: .

2024-05-14 work in progress

xkb X Keyboard Extension

xkb (X Keyboard Extension) is a more capable system to set keys in X11, than xmodmap. 〔see Linux: xmodmap Tutorial〕

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:

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

xkb resource

2024-05-14 offcial site http://www.x.org/wiki/XKB

2024-03-16 https://codeberg.org/ieure/xkbsucks

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