📜 ⬆️ ⬇️

The problem of the three layouts in Linux

Having at the same time three layouts (English, Russian, Ukrainian) is always confused in them, as it is not easy to distinguish them without looking at the indicator, and when the Ukrainian layout is in need, adding it and removing it is inconvenient each time. It is solved very simply by expanding the Russian layout with four additional Ukrainian letters (є, ї, і, ґ) and an apostrophe ('). The method does not claim to be unique, but no one here seems to have described it yet. First, in the settings of the layout, you need to select a key to select the keys of the third level:

Layout configs (in ubuntu, in other distributions, the path may differ) are in / usr / share / X11 / xkb / symbols /, in files ru, ua, us,
they describe key mappings to characters. It consists of sections that inherit each other, the common section is basic, so that if you change it, all children will change. For example, the description of the letter "e":

key <AC11> {[Cyrillic_e, Cyrillic_E]};

In square brackets, the first parameter is responsible for the symbol itself, the second for the + shift symbol, the third for the third-level key + symbol, the fourth for the third-level key + shift + symbol. In this case, there are only two parameters responsible for "e" and "e", if you write something like:
')
key <AC11> {[Cyrillic_e, Cyrillic_E, Ukrainian_ie, Ukrainian_IE]};

then we get “e”, “E” and with Alt-ohm "є" and "Є".

Having a little rummaged in the Ukrainian layout we find 5 necessary signs and we edit the Russian layout
sudo vim /usr/share/X11/xkb/symbols/ru
namely in the section:

key <AD12> {[Cyrillic_hardsign, Cyrillic_HARDSIGN, Ukrainian_yi, Ukrainian_YI]};
key <AC02> {[Cyrillic_yeru, Cyrillic_YERU, Ukrainian_i, Ukrainian_I]};
key <AC11> {[Cyrillic_e, Cyrillic_E, Ukrainian_ie, Ukrainian_IE]};
key <AD07> {[Cyrillic_ghe, Cyrillic_GHE, Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN]};
key <TLDE> {[Cyrillic_io, Cyrillic_IO, apostrophe]};

Now, to use Ukrainian letters, it is enough to press the corresponding key with the right Alt-e pressed:
і = Alt + s
ї = Alt +
`= Alt + her
є = Alt + u

Just in case, my / usr / share / X11 / xkb / symbols / ru .

“This material was written for the“ First Contest of Russian-language articles for Ubuntu OS 2011 ”(konkurs.ubuntu.ru)”.

Source: https://habr.com/ru/post/111059/


All Articles