Sure thing. Be aware that my knowledge is very limited in this area, I basically just googled things out. I’ll try to write this in a way that is less specific to oldhun
so it might be more generally helpful. My system is Arch Linux with Gnome and the latest updates from the stable repositories installed as of the writing of this post.
Resources that I found helpful:
1. Key maps are defined in /usr/share/X11/xkb/symbols
(and keycodes
)
Got the info from the medium article linked above. Looked into /usr/share/X11/xkb/symbols/hu
and found a section that defines a layout for oldhun
:
partial alphanumeric_keys
xkb_symbols "oldhun" {
name[Group1]="Old Hungarian";
include "level3(caps_switch_latch)"
include "level3(ralt_switch)"
key.type[Group1]="FOUR_LEVEL_SEMIALPHABETIC";
// In the remarks you can read characters displayed only Unicode point
key <AE01> {[U10CFA, apostrophe, 1, asciitilde ]};
//Old Hungarian one
key <AE02> {[ U10CFB, quotedbl, 2,quotedbl]};
//Old Hungarian five
...
Therefore I did not (yet) have to come up with a custom layout. Next up, how do I use what’s there?
2. Setting the layout
The /usr/share/X11/xkb/rules
folder
The medium article categorises this as “files to enable the configuration”. I don’t really know what the meaning of each file is in this folder but what I found is that oldhun
only appears in the ones that have “extras” in their name:
> grep -r oldhun .
./base.extras.xml: <name>oldhun</name>
./base.extras.xml: <shortDescription>oldhun</shortDescription>
./evdev.extras.xml: <name>oldhun</name>
./evdev.extras.xml: <shortDescription>oldhun</shortDescription>
Using Gnome 3.30
Out of the box on my system, Old Hungarian did not show up as an available input source in Settings > Region & Language > Input sources > + > Hungarian
.
After a bit of googling I found that I had to set the /org/gnome/desktop/input-sources/show-all-sources
to true
(I used the dconf
editor but gsettings
should also work from the command line).
Restarted the computer and Old Hungarian showed up as an available input source in Settings (not sure what triggers the list refresh, gnome/x restart or relogging, I wanted to makes ure).
Using the command line
This is something I am not sure about at this point. I tried the tools mentioned in the Arch wiki keyboard config page. After I did the GUI method above, these return the following:
> localectl
System Locale: LANG=en_GB.UTF-8
VC Keymap: uk
X11 Layout: gb,hu,hu
X11 Variant: ,102_qwertz_comma_nodead,oldhun
> setxkbmap -print
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+gb+hu(102_qwertz_comma_nodead):2+hu(oldhun):3+gb:4+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
So it might be as simple as setting the right values using those tools.
However, when I try to list the available variants as per the tool suggests, I don’t see oldhun
available:
> localectl list-x11-keymap-variants hu
101_qwerty_comma_dead
101_qwerty_comma_nodead
101_qwerty_dot_dead
101_qwerty_dot_nodead
101_qwertz_comma_dead
101_qwertz_comma_nodead
101_qwertz_dot_dead
101_qwertz_dot_nodead
102_qwerty_comma_dead
102_qwerty_comma_nodead
102_qwerty_dot_dead
102_qwerty_dot_nodead
102_qwertz_comma_dead
102_qwertz_comma_nodead
102_qwertz_dot_dead
102_qwertz_dot_nodead
nodeadkeys
qwerty
standard
It works properly though after setting it through the GUI. Perhaps extras need to be enabled somewhere else too to make them show up here? Needs further investigation.