How to the xkb layout settings be simplified

configurationkeyboardxkb

The question is, if there is a way to simplify the structure of the xkb configuration related to keyboard layouts?

As explained in further detail below there are 5 independent places in which a reference to a keyboard-layout-variant is stored (evdev.xml, evdev.lst, base.xml, base.lst, and inside the respective layout description files in /usr/share/X11/symbols/). It would be much simpler if there was only as many as needed (it is not helpful to store the same information in .lst and .xml as all additions or deletions of keyboard layouts need ot be done several times at 5 places)
Of course it also makes the whole configuration less clear to users (as it is confusing to have to set the very same configuration in a needless redundant fashion at several places). Maybe there is a way this can be simplified? If there was this would be the desired answer to this question. Given that there are many different distributions I would hope that not all have this xkb configuration setup.

This is how the xkb configuration looks on my GNU/Linux (Ubuntu 12.04LTS) box.
In order to add a new keyboard layouts to be used in my a respectable large number of many files must modified.

/usr/share/X11/xkb/rules/evdev
/usr/share/X11/xkb/rules/evdev.xml 
/usr/share/X11/xkb/rules/evdev.lst
/usr/share/X11/xkb/rules/base 
/usr/share/X11/xkb/rules/base.xml
/usr/share/X11/xkb/rules/base.lst

It seems to me that essentially base version of the files are copies of the evdev files it would be interesting to know if they could be made symbolic links like those files

/usr/share/X11/xkb/rules/xorg
/usr/share/X11/xkb/rules/xorg.lst
/usr/share/X11/xkb/rules/xorg.xml

Performing this little tests:
1.

 user@box:/$ cat /usr/share/X11/xkb/rules/evdev.lst | grep Greek
 gr              Greek
 simple          gr: Greek (simple)
 extended        gr: Greek (extended)
 nodeadkeys      gr: Greek (eliminate dead keys)
 polytonic       gr: Greek (polytonic)

2.

 user@box:/$ cat /usr/share/X11/xkb/rules/evdev.xml | grep Greek
       <description>Greek</description>
           <description>Greek (simple)</description>
            <description>Greek (extended)</description>
             <description>Greek (eliminate dead keys)</description>
             <description>Greek (polytonic)</description>
 ofencito@freak:/usr/share/X11/xkb/rules$ 

shows that both files contain virtually the very same data (which makes the same iformation being stored in 4 separate locations – even disregarding the symbolic links mentioned earlier).

Eventually the keyboard layouts are then themselves stored in a filesystem structure at /usr/share/X11/xkb/symbols, which agains stored references to
the language layout and variant in files named in accordantly. To keep our greek example there is a file /usr/share/X11/xkb/symbols/gr. Looking at this yields:

user@box:/$ cat /usr/share/X11/xkb/symbols/gr | grep xkb_symbols
xkb_symbols "basic" {
    name[Group1] = "Greek";
xkb_symbols "simple" {
    name[Group1] = "Greek (simple)";
xkb_symbols "bare" {
xkb_symbols "extended" {
    name[Group1] = "Greek (extended)";
xkb_symbols "polytonic" {
    name[Group1] = "Greek (polytonic)";
xkb_symbols "nodeadkeys" {
    name[Group1] = "Greek (eliminate dead keys)";

At this point the very same information has been reduntantly stored in 5 locations.

Is there a way to simplify this "mess"?
Since I am most familiar only with Ubuntu I wonder of course if other distributions might have found less confusion ways to deal with the keyboard layout?

Best Answer

I think the implementation is done in a hurry. See here: (use Google translation of Chrome)

https://www.linux.org.ru/forum/general/12078555

So there are places only reading .lst ignoring base.xml but the information they contain is not identical, and I guess xml is more complete, but not sure.

Related Question