* [RFC] xkb support in kbd
@ 2026-03-27 15:12 Alexey Gladkov
0 siblings, 0 replies; only message in thread
From: Alexey Gladkov @ 2026-03-27 15:12 UTC (permalink / raw)
To: linux console tools development discussion
Hi,
I have been working on xkb-based keymap import for kbd and would like to
ask for testing and feedback.
The work is here:
https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git/?h=xkb
The idea is to let `loadkeys` build a linux console keymap directly from
xkb settings such as model, layout, variant and options.
This is meant to make it easier to reuse the existing xkb layout data on
the linux console instead of relying only on pre-generated console
keymaps. In practice, this should make it possible to describe console
layouts in the same terms people already use elsewhere in the stack.
Since kernel keymaps and xkb differ significantly, the conversion has to
be done on the fly and not everything can be converted.
The groups (the layouts) are placed in the following way:
1 group : gr1->gr1->gr1->...
2 groups: gr1->gr2->gr1->gr2->...
3 groups: gr1->gr2->gr1->gr4->gr1->gr2->gr1->gr4->...
4 groups: gr1->gr2->gr3->gr4->gr1->gr2->gr3->gr4->...
This follows the order in which layouts are switched in the console-setup
from debian. Special thanks to Anton Zinoviev for the explanations
To build it from a git checkout, configure kbd with xkb support enabled:
./configure --enable-xkb
This requires libxkbcommon to be installed.
Once built, `loadkeys` accepts xkb parameters directly. For example:
./loadkeys \
--xkb-model=pc105 \
--xkb-layout=us,ru \
--xkb-options=grp:caps_toggle
To inspect the generated keymap without loading it into the kernel:
./loadkeys --tkeymap \
--xkb-model=pc105 \
--xkb-layout=us,ru \
--xkb-options=grp:caps_toggle
Testing would be especially useful for:
- non-trivial layouts and variants
- multi-layout setups
- AltGr and higher levels
- group switching options
- compose-heavy layouts
If you try it, reports with the exact `loadkeys` command line, the
expected behavior, and the actual behavior would be very helpful.
In addition, I wrote a proof-of-concept of utility that displays the
currently active layout in the top-right corner of the console.
contrib/vcslayout.c
I would also appreciate hearing your comments or suggestions regarding
this approach.
--
Rgrds, legion
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-27 15:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 15:12 [RFC] xkb support in kbd Alexey Gladkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox