michalkahle / czech-coder-xkb

Linux xkb keyboard layout for coders who need to write Czech.
MIT License
75 stars 8 forks source link
coders czech keyboard-layout linux

Use both US and Czech keyboard layout in Linux without switching

Constant keyboard layout switching hampers your productivity. It certainly hampered mine. With this keyboard layout you can forget about keyboard switching and let your muscle memory handle it.

Czech coder layout is inspired by the Czech Programmers keyboard layout in Windows with one significant difference: Czech coder lets you type fluently in Czech with pressed AltGr without the need to release it! When you do release the AltGr, you are back to US layout which is optimal for coding.

How it works

The basic layout is US so that all symbols are available and all keyboard shortcuts work as intended. When you hold AltGr with your right thumb the layout changes to Czech (qwerty variant; there is as little rearrangement as possible). With use, you will learn to press the right Alt unconsciously.

Upper case of accented letters are available with AltGr + Shift combination. Euro sign is available under AltGr + Shift + e.

Disadvantages and compromises

Installation

Unfortunately, the following instructions do not work with Wayland. There are only instructions for SwayWM for now. Please help me to make it work there. I'll update these instructions when I learn the proper way how to switch keyboard layouts on Wayland.

On Ubuntu 20.4 and later or its derivatives the 'coder' variant is already present.

In older versions of Debian/Ubuntu/Mint:

Other distros: Look into the patches what needs to be done. When you make it work, please submit PR with instructions.

If you run into troubles please open an issue so that we can fix it.

Very similar layout is available for macOS.

Wayland

In wayland, input and output configuration is the job of the compositor. Thus, setting a keyboard layout varies.

For SwayWM, add this to your config:

input * {
    xkb_layout "cz"
    xkb_variant "coder"
}

Or if you want to use multiple layouts in the same time (and switch them by CapsLock):

input "type:keyboard" {
    xkb_layout "cz(coder),us"
    xkb_options "grp:caps_toggle,grp_led:caps"
}

If you know how to set up keyboard layout for other WMs/DEs, please submit a PR.

Používejte na Linuxu americké i české rozložení kláves bez přepínání

Neustálé přepínání rozložení klávesnice sníží vaši produktivitu. Mně strašně lezlo na nervy. S tímto rozložením můžete přestat myslet na přepínání klávesnice a nechat to vašemu podvědomí.

Rozložení Czech coder bylo inspirováno Českým programátorským rozložením pro Windows s jedním zásadním rozdílem: České programátorské rozložení umožňuje psát znaky s diakritikou po stisku AltGr, ale znaky bez diakritiky nejsou v tomto módu dostupné. Musíte pustit AltGr, abyste je mohli napsat. To znamená nutnost stisknout a uvolnit AltGr i několikrát při psaní jednoho slova! To je při psaní všemi deseti zcela nepoužitelné. Rozložení Czech coder tohle řeší a umožní vám psát celé věty a odstavce česky se stisknutým AltGr.

Jak to funguje

Základní rozložení je US, takže jsou dostupné všechny symboly a klávesové zkratky fungují bez problémů. Při stisku AltGr pravým palcem se rozložení změní na české (querty, aby byly změny minimální). S používáním se brzy naučíte mačkat AltGr při psaní češtiny podvědomě.

Velká písmena s diakritikou jsou dostupná s AltGr + Shift. Znak euro je dostupný pod AltGr + Shift + e.

Návod na instalaci výše.