You are not logged in.

#1 2023-06-17 18:34:42

tsmx
Member
Registered: 2019-10-20
Posts: 3

Right way to change XKB configs?

Specifically: what's the right way to create custom system-wide keyboard layout without pacman overwriting it?

I've read https://wiki.archlinux.org/title/X_keyboard_extension and manually edited keyboard layout in /usr/share/X11/xkb/symbols/us. My changes work as intended.
Unfortunately it seems that any upgrades of xkeyboard-config package would overwrite my changes. Is there a way to avoid it?
The only way I could make out of the aforementioned article is using xkbcomp at some point after X server startup to dump XKB config, then appending new layout to it, then uploading the updated config back into X server. This sounds incredibly hacky, is there a better way? Maybe I can put something in /etc? Other packages usually keep user-editable configuration there but I can't find anything XKB-ish in my /etc.

Offline

#2 2023-06-17 19:16:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,137
Website

Re: Right way to change XKB configs?

that wiki page wrote:

Look inside /usr/share/X11/xkb/rules/ for *.lst files or the XKB Homepage to get ideas on how to configure rules. Your own configurations can go in /etc/X11/xorg.conf.d/

Note that user-specific settings can also go under ~/.xkb/

Last edited by Trilby (2023-06-17 19:19:42)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-06-17 20:28:28

tsmx
Member
Registered: 2019-10-20
Posts: 3

Re: Right way to change XKB configs?

Trilby wrote:

Look inside /usr/share/X11/xkb/rules/ for *.lst files or the XKB Homepage to get ideas on how to configure rules. Your own configurations can go in /etc/X11/xorg.conf.d/

This statement from wiki page does not make sense to me. Okay, there are a couple of .lst files (and also a couple of .xml files). What should I do with them? I obviously can't edit them because they will get overwritten as well.
Putting XKB configs into /etc/X11/xorg.conf.d makes even less sense because this directory contains X server configs and has zero relation to XKB, I don't understand what the person who wrote this wanted to say.

Trilby wrote:

Note that user-specific settings can also go under ~/.xkb/

I don't want my layout to be user-specific, I want it to be system-wide, including display manager login screen.
By the way, where is this written? Maybe there's more where that came from? I only found this page https://xkbcommon.org/doc/current/md_do … ation.html and it also says something about /etc/xkb which looks nice but I still don't understand how a config overriding a single layout from /usr/share should be structured in that directory. It also has an unsettling warning about something something not works in X and I feel like this documentation might be for the wrong thing.

Offline

#4 2023-06-17 20:58:44

seth
Member
Registered: 2012-09-03
Posts: 56,285

Re: Right way to change XKB configs?

https://wiki.archlinux.org/index.php?ti … did=362133
It's wrong and should be /etc/xkb

Is there a way to avoid it?

/etc/xkb/symbols/us shadows /usr/share/X11/xkb/symbols/us

unsettling warning about something something not works in X

You mean

Where libxkbcommon runs in a privileged context, only the system (datadir) path is available.

That's neither unsettling nor "something something" and irrelevant unless you run X11 as root.
https://wiki.archlinux.org/title/Xorg#Rootless_Xorg

If you can't help it or just want to be safe™:
Don't edit the file in place, copy it to "tsmx" or whatever - the document you linked actually touches on that scenario quite a bit.

Offline

Board footer

Powered by FluxBB