Hook up a `custom` empty layout in the ruleset by default
libxkbcommon parses user-specific layouts in $HOME/.config/xkb (blog series here). That's for Wayland only though because X has too many moving parts to get those hooked up reliably.
But people still use X and run into issues like !186 (closed) or #255 (closed) which (often) call for local solutions rather than upstream solutions.
So I'm wondering: should we simply hook up some custom
layout in base.xml
with basic documentation ("User-defined custom layout"). This will make it accessible in the configuration GUIs, and the way our rulesets currently work a layout custom
will map to symbols/custom
anyway.
The key here is that we don't ship symbols/custom
, it's up to the user to provide that. But at least it won't get overwritten on updates.
Not as powerful as the full user-specific layouts but it'll solve a good number of problems X11 users currently have.
edit:
How to use this layout
A longer blog post is here but the simple instructions are:
$ cat > /usr/share/X11/xkb/symbols/custom <<EOF
default
xkb_symbols "basic" {
include "de(basic)"
key <AD12> { [ a, b, c, d ] };
};
EOF
And that's it. The above example is a a german base keyboard (using section "basic" from symbols/de
) and overrides the AD12 key (+
/*
) with a four-level key producing a
, b
on Shift, c
on Alt, and d
on Alt+Shift.
The custom
keyboard layout should be available in any GUI configuration tool and of course with the commandline tools like setxkmap -layout custom
.
Limitation: custom
can only be a layout, not a variant and it must define the whole key set. Use include "$lang(basic)"
for your language as the first line in the new layout.