Since version 1.13 xkbcommon facilitates installing keyboard layout packages using a new mechanism: the XKB extensions directories. It provides a proper way for keyboard layout packages to install their files, which otherwise resorted to hacking the xkeyboard-config system directory.
@note See also the following alternatives without packaging:
@tableofcontents{html:2}
There are 2 root extensions directories, both optional:
XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH
XKB_CONFIG_VERSIONED_EXTENSIONS_PATH
@note XKB_CONFIG_VERSIONED_EXTENSIONS_PATH has higher priority than
XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH.
When appending the default include paths, after the extra path but before the canonical XKB root, for each extensions directory hereinabove: its subdirectories are appended in lexicographic order to the include paths; unversioned subdirectories are appended only if there is no corresponding versioned subdirectory.
Example: given the following setup:
XKEYBOARD_CONFIG_ROOT = /usr/share/xkeyboard-config-2/usr/share/xkeyboard-config-2.d tree:
p1 (installed by package p1)rules/evdev.xmlsymbols/ap2 (installed by package p2)rules/evdev.xmlsymbols/b/usr/share/xkeyboard-config.d tree:
p1 (installed by package p1)rules/evdev.xmlsymbols/ap3 (installed by package p3)rules/evdev.xmlsymbols/cthen the include path list may be:
~/.config/xkb (user path)~/.xkb (alternative user path)/etc/xkb (extra path)/usr/share/xkeyboard-config-2.d/p1/usr/share/xkeyboard-config-2.d/p2/usr/share/xkeyboard-config.d/p3/usr/share/xkeyboard-config-2 (canonical root)In this example:
/usr/share/xkeyboard-config.d/p1 path is not included.libxkbcommon 1.13+ and xkeyboard-config 2.45+ using
their pkg-config files. The libxkbcommon dependency will be necessary until
xkeyboard-config ships a pkg-config file with the needed variables (see
hereinafter).xkeyboard-config directories,
unless there is a need to provide the layout for X11-only sessions, because
they do not support XKB directories other than the hard-coded one in the X
server.<XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH>/<PACKAGE_NAME>/<KCCGST_DIR>, where:
XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATHxkb_unversioned_extensions_path from the libxkbcommon
or xkeyboard-config pkg-config file
PACKAGE_NAMEKCCGST_DIRsymbols, types, etc.@note If a custom rules file is required (e.g. to add an option), name it
<ruleset>.post (note the .post suffix) to enable composability with other
packages. See @ref rmlvo-resolution "" for further details.
<XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH>/<PACKAGE_NAME>/rules/evdev.xml.See @ref discoverable-layouts "" for further information.
When xkeyboard-config v3 is out:
<XKB_CONFIG_VERSIONED_EXTENSIONS_PATH_V2>
(previously <XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH>) and then install the v3
files with the new features in <XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH>.When xkeyboard-config v4+ is out, proceed similarly to step 5 with the corresponding xkeyboard-config version.
[KcCGST]: @ref KcCGST-intro