Keyboard configuration in console
Keyboard mappings (keymaps) for virtual console, console fonts and console maps are provided by the package (it should already be installed), which also provides many low-level tools for managing virtual console.
Viewing keyboard settings
You can use the following command to view keyboard configuration:
$ localectl status
System Locale: LANG=en_GB.utf8 LC_COLLATE=C VC Keymap: cz-qwertz X11 Layout: cz
Setting keyboard layout
Unlike XKB keyboard layout, which is composed of multiple components, the keyboard layout for virtual console has only one component. Usually one keymap file corresponds to one keyboard layout (the include statement can be used to share common parts and a keymap file can contain multiple layouts with some key combination used for switching). The keymap files are stored in
/usr/share/kbd/keymaps/ directory tree. You can use the following command to list all available keymaps:
$ localectl list-keymaps
High-level configuration can be done in
/etc/vconsole.conf, which is read by systemd on start-up. The
KEYMAP variable is used for specifying keymap. If the variable is empty or not set, the
us keymap is used as default value. See
man 5 vconsole.conf for all options. For example:
For convenience, localectl may be used to set console keymap. It will change the
KEYMAP variable in
/etc/vconsole.conf and set the keymap for current session. For example:
$ localectl set-keymap --no-convert keymap
man 1 localectl for details.
Of course it is possible to set a keymap just for current session. This is useful for testing different keymaps, solving problems etc.
The loadkeys tool is used for this purpose, it is used internally by systemd when loading the keymap configured in
/etc/vconsole.conf. It can be used very simply for this purpose:
# loadkeys keymap
man 1 loadkeys details.
Changing console font
The configuration is done in
vconsole.conf using the
... FONT=Lat2-Terminus16 FONT_MAP=8859-2
FONT variable is empty or not set, the kernel built-in font is used as default. See
man 5 vconsole.conf for details.