summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-05-12 14:09:50 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-07-06 15:15:20 +1000
commitafb26e7df9090a0b765eb294b6efff448f763b6f (patch)
treeed8820db131fde2f5190333e0776aced657629d7 /doc
parentfe8861338242762da6a3245a106042266280714c (diff)
downloadxorg-lib-libxkbcommon-afb26e7df9090a0b765eb294b6efff448f763b6f.tar.gz
Add libxkbregistry to query available RMLVO
This library is the replacement for clients parsing evdev.xml directly. Instead, they should use the API here so that in the future we may even be able to swap evdev.xml for a more suitable data format. The library parses through evdev.xml (using libxml2) and - if requested - through evdev.extras.xml as well. The merge approach is optimised for the default case where we have a system-installed rules XML and another file in $XDG_CONFIG_DIR that adds a few entries. We load the system file first, then append any custom ones to that. It's not possible to overwrite the MLVO list provided by the system files - if you want to do that, get the change upstream. XML validation is handled through the DTD itself which means we only need to check for a nonempty name, everything else the DTD validation should complain about. The logging system is effectively identical to xkbcommon. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'doc')
-rw-r--r--doc/user-configuration.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/user-configuration.md b/doc/user-configuration.md
index 886950a..17e7179 100644
--- a/doc/user-configuration.md
+++ b/doc/user-configuration.md
@@ -154,3 +154,66 @@ xkb_symbols "baz" {
With these in place, a user may select any layout/variant together with
the "custom:foo" and/or "custom:baz" options.
+
+## Discoverable layouts
+
+**The below requires libxkbregistry as XKB lookup tool and does not work where
+clients parse the XML file directly**.
+
+The above sections apply only to the data files and require that the user knows
+about the existence of the new entries. To make custom entries discoverable by
+the configuration tools (e.g. the GNOME Control Center), the new entries must
+also be added to the XML file that is parsed by libxkbregistry. In most cases,
+this is the `evdev.xml` file in the rules directory. The example below shows the
+XML file that would add the custom layout and custom options as outlined above
+to the XKB registry:
+
+```
+$ cat $XDG_CONFIG_HOME/xkb/rules/evdev.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">
+<xkbConfigRegistry version="1.1">
+ <layoutList>
+ <layout>
+ <configItem>
+ <name>banana</name>
+ <shortDescription>ban</shortDescription>
+ <description>Banana</description>
+ </configItem>
+ <variantList>
+ <variant>
+ <configItem>
+ <name>orange</name>
+ <shortDescription>or</shortDescription>
+ <description>Orange (Banana)</description>
+ </variant>
+ </variantList>
+ </layoutList>
+ <optionList>
+ <group allowMultipleSelection="true">
+ <configItem>
+ <name>custom</name>
+ <description>Custom options</description>
+ </configItem>
+ <option>
+ <configItem>
+ <name>custom:foo</name>
+ <description>Map Tilde to nothing</description>
+ </configItem>
+ </option>
+ <option>
+ <configItem>
+ <name>custom:baz</name>
+ <description>Map Z to K</description>
+ </configItem>
+ </option>
+ </group>
+ </optionList>
+</xkbConfigRegistry>
+```
+
+The default behavior of libxkbregistry ensures that the new layout and options
+are added to the system-provided layouts and options.
+
+For details on the XML format, see DTD in `<datadir>/X11/xkb/rules/xkb.dtd`
+and the system-provided XML files in `<datadir>/X11/xkb/rulies/xkb.dtd`.