Skip to content

xkbinfo: use libxkbregistry to parse the rules files for us

Peter Hutterer requested to merge whot/gnome-desktop:wip/xkbregistry into master

Available in libxkbcommon 1.0.0 and later, libxkbregistry is a library wrapper around the evdev.xml rules file that we used to parse directly here. It provides a basic iteration API - load the evdev ruleset, then iterate through the layouts and options and copy the values over into our data structures as needed. This removes the need for XML parsing and error-checking, we can now rely on libxkbregistry to do this for us.

The side-effect of this (and motivation for libxkbregistry) is that we automatically load user-specific XKB RMLVO as well where they are present. Together with mutter commit f71238732508d91bdfcb581c84697a516499a1eb this allows a user to drop up their custom XKB layouts in $XDG_CONFIG_DIR/xkb and have them both listed in the GUIs and working.

Edited by Peter Hutterer

Merge request reports