KEYBOARD(5)
๐ KEYBOARD(5) ๐
okay bestie, welcome to the keyboard manual page, straight out of the Console-setup User's Manual. it's giving "your keyboard's whole personality lives in one lil file." let's get into it ๐
โจ NAME โจ
keyboard โ the keyboard configuration file, aka the glow-up document for your keys โจ๏ธ๐
๐ธ DESCRIPTION ๐ธ
so the keyboard file describes the properties of your keyboard. like, all of them. it gets read by setupcon(1) so it can configure the keyboard on the console. on Debian systems, the default keyboard layout lives in /etc/default/keyboard, and โ plot twist โ it's shared between X and the console. one file, two worlds, iconic behavior honestly ๐ซถ
the way this works is that the layout spec in the keyboard file is based on the XKB options XkbModel, XkbLayout, XkbVariant and XkbOptions. and yeah, ngl, there's little documentation on how to actually use them ๐ญ but bestie, the description of all possible values for these options can be found in the file base.lst. so that's your girl. go there.
you might also wanna read "The XKB Configuration Guide" by Kamil Toman and Ivan U. Pascal:
http://www.xfree86.org/current/XKB-Config.html
other possible readings (the reading list is reading, fr fr):
https://wiki.archlinux.org/index.php/X_KeyBoard_extension
http://pascal.tsu.ru/en/xkb/
http://www.charvolant.org/~doug/xkb/
and if you want the complete XKB-specification, it's on:
http://xfree86.org/current/XKBproto.pdf
now, the keyboard file itself? it's just variable settings in POSIX format:
VARIABLE=VALUE
โ ๏ธ only ONE assignment per line, bestie. do not get cute with it. comments starting with # are also allowed, so you can leave lil notes for yourself ๐
๐ OPTIONS ๐
here's the whole squad of variables you can set. no skipping, we're covering every single one ๐
XKBMODELโ specifies the XKB keyboard model name. Default:pc105on most platforms. she's the blueprint ๐ฆXKBLAYOUTโ specifies the XKB keyboard layout name. this is usually the country or language type of the keyboard. Default:uson most platforms ๐XKBVARIANTโ specifies the XKB keyboard variant components. these can be used to further specify the keyboard layout details. Default: not set.XKBOPTIONSโ specifies the XKB keyboard option components. options usually relate to the behavior of the special keys (<Shift>,<Control>,<Alt>,<CapsLock>, etc.) Default: not set. these are the divas of your keyboard ๐BACKSPACEโ determines the behavior of<BackSpace>and<Delete>keys on the console. Allowed values:bs,delandguess. in most cases you can specifyguesshere, in which case the current terminal settings and the kernel of your operating system will be used to determine the correct value. valuebsspecifies VT100-conformant behavior:<BackSpace>will generate^H(ASCII BS) and<Delete>will generate^?(ASCII DEL). valuedelspecifies VT220-conformant behavior:<BackSpace>will generate^?(ASCII DEL) and<Delete>will generate a special function sequence. choose wisely bestie ๐KMAPโ usually this variable will be unset, but if you don't want to use a XKB layout on the console, you can specify an alternative keymap here. specify a file that is suitable as input forloadkeys(1)on Linux or forkbdcontrol(1)on FreeBSD. the backup plan energy โจ
๐ฆ FILES ๐ฆ
- the standard location of the
keyboardfile is/etc/default/keyboard. home sweet home ๐ - description of all available keyboard models, layouts, variants and options is available in
/usr/share/X11/xkb/rules/base.lst. the lore document ๐ - in most cases, in
/lib/kbd/keymaps/you will find several keymaps that can be used with the variableKMAP. the options are options-ing ๐ง
๐ NOTES ๐
on Debian systems, changes in /etc/default/keyboard do not become immediately visible to X. rude, i know ๐ you should either reboot the system, or use:
udevadm trigger --subsystem-match=input --action=change
and to activate the changes on the console, run setupcon(1). slay ๐ซถ
๐ BUGS ๐
okay so these are the known quirks, no cap, be aware:
- when a triple-layout is used on the console, i.e. a layout with three XKB groups, then the group toggling happens in the following way:
Group1->Group2->Group1->Group3. it's giving chaos but that's literally how it is ๐ญ - on FreeBSD triple- and quadruple-layouts are not supported on the console (only the first and the second layout are taken into account). FreeBSD said two is enough bestie ๐
- the option
grp:shifts_toggleis not supported on the console. periodt ๐
โญ EXAMPLES โญ
example 1 โ the following configuration will give you the standard US QWERTY layout (us). the key <Menu> will act as a compose key (compose:menu) and <CapsLock> will act as third control key (ctrl:nocaps).
XKBLAYOUT=us
XKBVARIANT=
XKBOPTIONS=compose:menu,ctrl:nocaps
example 2 โ in the following configuration the right <Alt> key (grp:toggle) will toggle between US QWERTY layout (us) and Greek (gr) layout. the option grp_led:scroll is ignored on the console, but in X it means to use the ScrollLock keyboard led as indicator for the current layout (US or Greek).
XKBLAYOUT=us,gr
XKBVARIANT=
XKBOPTIONS=grp:toggle,grp_led:scroll
example 3 โ in the following configuration the <Control>+<Shift> key combination will toggle (grp:ctrl_shift_toggle) between French keyboard (fr) without dead keys (nodeadkeys) and British (gb) "Dvorak" (dvorak) keyboard. the right <Win> key will be a compose-key (compose:rwin) and the right <Alt> key will function as AltGr (lv3:lalt_switch).
XKBLAYOUT=fr,gb
XKBVARIANT=nodeadkeys,dvorak
XKBOPTIONS=grp:ctrl_shift_toggle,compose:rwin,lv3:ralt_switch
๐ SEE ALSO ๐
setupcon(1), ckbcomp(1), console-setup(5), loadkeys(1), kbdcontrol(1)
and that's the whole page bestie, you ate that ๐ this was console-setup, dated 2011-03-17, and it's the KEYBOARD(5) manual. go forth and configure your keys, main character โจ๏ธโจ๐ฆ
๐ฆ where this page comes from
- fedora 43: console-setup 1.239-2.fc43 ยท GPL-2.0-or-later AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: console-setup 1.245-3.fc44 ยท GPL-2.0-or-later AND MIT AND LicenseRef-Fedora-Public-Domain
- Copyright (C) 2011 Anton Zinoviev <anton@lml.bas.bg>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms