DEV Community

pallade
pallade

Posted on

Customizing EurKey on Ubuntu

This has been tested in Ubuntu 24.04.

When you need to type in different languages, you can configure your OS to handle their respective layouts. Often, when switching layout, more than just the letters change: punctuation and shifted keys can change too, and you need to continuously adjust (where is the open parenthesis? Shifted 9 or someplace entirely different? What happens if you hit the key right of L? Etc...).

I recently switched to a ZSA Voyager programmable keyboard, and I had enough of continuously mistyping special characters and furiously switching keyboard layouts. I needed a single layout that would let me type everything! Eurkey could be the answer but... EurKey, despite its name, does not handle all the language spoken in Europe!

I needed to support Italian, English and German (which are supported) and Polish (which is not). I also do programming.

My solution was to create a new OS layout, based on Eurkey. This is not portable, but it makes my life easier most of the time.

Situation Portability
On my own Ubuntu pc Everything works
On a PC with EurKEY Set layout to EurKey. Italian, German and English work, Polish does not work
On a PC without EurKey Set language to English. Ita, Ger, Pl do not work.

Here is the resulting layout on Oryx, the ZSA configuration utility from ZSA (it should be easy to reproduce on other programmable keyboards): https://configure.zsa.io/voyager/layouts/ymMez/latest/0

First, get the Eurkey layout (print it is you prefer!) and choose a few keys on the AltGr layer you will never use (for me, the first keys on the Q row are fine): you will override them with other keys that you will use. Decide, for each key, what should it produce when hit with AltGr.

In my case:

Key Key + AltGr will produce
Q ą
W ę
E ó
R ć
etc... ...

Now follow this tutorial (or the newer version linked there): https://codeaffen.org/2022/02/07/custom-keyboard-layout/

  1. In /usr/share/X11/xkb/symbols create a new euspecial file and add the following content:
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic"  {
    include "eu"

    key <AD01>  {[            q,               Q,              aogonek,              Aogonek  ]};
    key <AD02>  {[            w,               W,              eogonek,              Eogonek  ]};
    key <AD03>  {[            e,               E,               oacute,               Oacute  ]};
    key <AD04>  {[            r,               R,               cacute,               Cacute  ]};
    key <AD05>  {[            t,               T,            zabovedot,            Zabovedot  ]};
    key <AD06>  {[            y,               Y,               zacute,               Zacute  ]};
    key <AD07>  {[            u,               U,               nacute,               Nacute  ]};
    key <AD08>  {[            i,               I,              lstroke,              Lstroke  ]};
    key <AD09>  {[            o,               O,               sacute,               Sacute  ]};

    include "level3(ralt_switch)"
};

Enter fullscreen mode Exit fullscreen mode

This changes the behavior of keys Q, W, E... through O on the first row.

  1. In /usr/share/X11/xkb/rules/evdev.extras.xml, add a new layout section alongside the others, inside the section:
    <layout>
      <configItem popularity="exotic">
        <name>euspecial</name>
        <!-- Keyboard indicator for European layouts -->
        <shortDescription>eu</shortDescription>
        <description>EurKEY (Special)</description>
        <countryList>
          <iso3166Id>US</iso3166Id>
        </countryList>
        <languageList>
          <iso639Id>cat</iso639Id>
          <iso639Id>dan</iso639Id>
          <iso639Id>eng</iso639Id>
          <iso639Id>est</iso639Id>
          <iso639Id>fao</iso639Id>
          <iso639Id>fin</iso639Id>
          <iso639Id>deu</iso639Id>
          <iso639Id>ell</iso639Id>
          <iso639Id>gsw</iso639Id>
          <iso639Id>ita</iso639Id>
          <iso639Id>lav</iso639Id>
          <iso639Id>lit</iso639Id>
          <iso639Id>nld</iso639Id>
          <iso639Id>nor</iso639Id>
          <iso639Id>por</iso639Id>
          <iso639Id>spa</iso639Id>
          <iso639Id>swe</iso639Id>
        </languageList>
      </configItem>
    </layout>
Enter fullscreen mode Exit fullscreen mode

Now you should see a new "Eurkey (Special)" entry in your keyboard layout list. If not, restart your computer.

Top comments (0)