kippakap via Qubes OS Forum qubes_os@forum.qubes-os.org writes:
Hey, I have a closely related problem, and I’m trying to figure out how to use your solution. I
think it’s just that I’m not sure how to define a keymap that can be loaded by xkbcomp. On all my
previous systems, I’ve been using a custom layout defined in /usr/share/X11/xkb/symbols/us by adding
in a block
partial alphanumeric_keys
xkb_symbols "custom" {
include "us(dvorak)"
name[Group1]= "US (dvorak custom)";
key <CAPS> { [ ISO_Level3_Shift ] };
key <AD01> ...
...
};
and then selecting US (dvorak custom) as the variant.
Where ? With the qubes interface or with the regular command setxkbmap ?
I’ve tried saving the contents of that block as a file (test.xkb) and running
xkbcomp test.xkb $DISPLAY
and nothing is changed. I’m probably just misunderstanding how a symbols map should be defined for xkbcomp.
From memory xkbcomp only load a map, if you want to assemble it, you
have to look at the setxkbmap command, and here you can specify
includes in the files, or specify variants and options on the command
line. xkbcomp expect a full keymap (except the useless geometry section).
If that confuse you, look a the map dumped by your actual config with
$ xkbcomp $DISPLAY test.xkb
That is a keymap already assembled, to use again with xkbcomp. It is
different of what you find in /usr/share/X11/xkb/* that are part of
configurations waiting to be assembled, as the different directory names
suggest.
Note that if you understand the syntax, you can simply edit by hand the
map dumped, and load it again with your change rather to have to deal
with setxkbmap.
Alternatively, is there a smart way (possibly salt?) to make my modified
/usr/share/X11/xkb/symbols/us be loaded in dom0 and all VMs during xinit rather than using a systemd
service to have xkbcomp load a separately defined map?
You could modify /etc/X11/Xsession.d/90qubes-keymap (debian) and
/etc/X11/xinit/xinitrc.d/qubes-keymap.sh (fedora) with a script to load
your custom options.
Or modify /usr/share/X11/xkb/symbols/us by inlining your modifications
in the default keymap and expect it to be loaded by default. In both
case you have to chattr
theses files so updates won’t overwrite your
changes.
I think I would do one of them when I will rewrite that part of my
configuration and effectively that can be done easily enough with a
file.managed an a cmd.run states with salt.