How to Create a Custom Keyboard Layout?

I tried following this tutorial, but it just doesn't work.

Basically I pasted this into /usr/share/X11/xkb/symbols/ru:

partial alphanumeric_keys
xkb_symbols "wlasna" {

    include "pl"
    name[Group1]= "Russian (custom)";

    key <LatQ> { [    Cyrillic_shcha,    Cyrillic_SHCHA  ] };
    key <LatZ> { [       Cyrillic_ze,       Cyrillic_ZE,    Cyrillic_zhe,      Cyrillic_ZHE  ] };
    key <LatS> { [       Cyrillic_es,       Cyrillic_ES,    Cyrillic_sha,      Cyrillic_SHA  ] };
    key <LatA> { [        Cyrillic_a,        Cyrillic_A,     Cyrillic_ya,       Cyrillic_YA  ] };
    key <LatW> { [       Cyrillic_ve,       Cyrillic_VE  ] };
    key <LatC> { [      Cyrillic_tse,      Cyrillic_TSE,    Cyrillic_che,      Cyrillic_CHE  ] };
    key <LatX> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN  ] };
    key <LatD> { [       Cyrillic_de,       Cyrillic_DE  ] };
    key <LatE> { [       Cyrillic_ie,       Cyrillic_IE,      Cyrillic_e,        Cyrillic_E  ] };
    key <LatV> { [ Cyrillic_softsign, Cyrillic_SOFTSIGN  ] };
    key <LatF> { [       Cyrillic_ef,       Cyrillic_EF  ] };
    key <LatT> { [       Cyrillic_te,       Cyrillic_TE  ] };
    key <LatR> { [       Cyrillic_er,       Cyrillic_ER  ] };
    key <LatN> { [       Cyrillic_en,       Cyrillic_EN  ] };
    key <LatB> { [       Cyrillic_be,       Cyrillic_BE  ] };
    key <LatH> { [       Cyrillic_ha,       Cyrillic_HA  ] };
    key <LatG> { [      Cyrillic_ghe,      Cyrillic_GHE  ] };
    key <LatY> { [     Cyrillic_yeru,     Cyrillic_YERU  ] };
    key <LatM> { [       Cyrillic_em,       Cyrillic_EM  ] };
    key <LatJ> { [   Cyrillic_shorti,   Cyrillic_SHORTI  ] };
    key <LatU> { [        Cyrillic_u,        Cyrillic_U,     Cyrillic_yu,       Cyrillic_YU  ] };
    key <LatK> { [       Cyrillic_ka,       Cyrillic_KA  ] };
    key <LatI> { [        Cyrillic_i,        Cyrillic_I  ] };
    key <LatO> { [        Cyrillic_o,        Cyrillic_O  ] };
    key <LatL> { [       Cyrillic_el,       Cyrillic_EL  ] };
    key <LatP> { [       Cyrillic_pe,       Cyrillic_PE  ] };
};

(If you are wondering what I was trying to achieve - phonetic keyboard, but with all non letter symbols in the same place as in my native language (polish), and with "special" symbols as alternate character on keys closest to them in pronunciation, not just on random keys (for example A key + alt - я, ю on U + alt, ш on S + alt, etc.).)

Then I put this into /usr/share/X11/xkb/rules/evdev.xml:

 <variant>
   <configItem>
     <name>wlasna</name>
     <description>Russian (custom)</description>
   </configItem>
 </variant> 

And then I restarted computer, and... I still can't find my custom layout in layouts' list :/

Did I do something wrong, or is just this tutorial outdated, and I should use another one? Because I can't spot any error.

1 Answer

It works fine for me. :)

Please note that you need to put it in evdev.xml as a variant of the Russian layout, i.e. somewhere below this part:

    <layout>
      <configItem>
        <name>ru</name>
        <!-- Keyboard indicator for Russian layouts -->
        <shortDescription>ru</shortDescription>
        <description>Russian</description>
        <languageList>
          <iso639Id>rus</iso639Id>
        </languageList>
      </configItem>
      <variantList>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest