What are the steps to setting up a custom keyboard layout in X11 without root access? I know it's possible, based on this answer, but I get Error loading new keyboard description
whenever I try using my new layout.
In .config
I have created a xkb
directory as follows:
xkb/
rules/
evdev-local
evdev-local.lst
evdev-local.xml
symbols/
my-us
In my evdev-local.xml
in the <layoutList>
section I added
<layout>
<configItem>
<name>my-us</name>
<shortDescription>my-us</shortDescription>
<description>English (My US)</description>
<languageList>
<iso639Id>eng</iso639Id>
</languageList>
</configItem>
<variantList>
<variant>
<configItem>
<name>mdvp</name>
<description>English (Modified Programmer Dvorak)</description>
</configItem>
</variant>
</variantList>
</layout>
and the symbols/my-us
file is
partial alphanumeric_keys
xkb_symbols "mdvp" {
include "us(dvp)"
name[Group1] = "English (Modified Programmer Dvorak)";
// Unmodified Shift AltGr Shift+AltGr
// upper row, left side
key <AD01> { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] };
// lower row, left side
key <AB01> { [ semicolon, colon, dead_ogonek, dead_doubleacute ] };
include "level3(ralt_switch)"
};
I then run
setxkbmap -I ~/.config/xkb/ -rules evdev-local -layout my-us
and get
Error loading new keyboard description
Back story: I've been using Programmer's Dvorak, and I like it for the most part, but I want to switch the semicolon and apostrophe back to their positions on US Dvorak, since that works better for my workflow.
I have seen this tutorial recommended on SE, and it works on my machine, but I need to be able to use the KDE layout switcher widget so I can switch back to plain English QWERTY when someone else needs to work on my machine.
Best Answer
For some reason it works if you
-print
and pipe the output toxkbcomp
:I don’t think there is anything wrong with your layout. I tried setting it up with
setxkbmap
directly, but even with the-verbose
option the output is not helpful:This is with the default verbose level. But even if I set it to 10, which is apparently the max level, it just outputs “locale is C” as well as where it tries to look for the rules file, in addition to the above. It does not output anything more about why it fails to load the keyboard description.
One of the reasons why I prefer to pipe to
xkbcomp
instead of just usingsetxkbmap
is because the former seems to give better error messages.