Remapping keys for azerty keyboard in Linux
Misc ·I learned to type on a french keyboard (azerty) and that’s kind of the muscle memory that I have.
Now that I live in the US I have to remap my keyboard and it’s mostly ok but for the <
and >
signs, on a Macbook it’s kind of ok as it’s located on the key before number 1, but on Linux PC it’s kind of hard it’s a combinaison of Level3 (AltGr
) + x
or z
(depending on the desired key).
It’s not super easy to type so I decided to remap the tilde
key that I don’t have a use for (because tilde
is actually somewhere else in the french keymap).
To to so, it’s a bit hacky, I’m creating a new rule file called in /usr/share/X11/xkb/rules/evdev2
with the following content:
```! option = symbols
frenchonenglish:lessergreater = +lessandgreater(lessergreater)
! include /usr/share/X11/xkb/rules/evdev
And a symbol file `/usr/share/X11/xkb/symbols/lessandgreater` with the following content:
xkb_symbols “lessergreater” {
key
Finally I'm setting a new xkb option to use my new `frenchonenglish:lessergreater` rule using `dconf`:
dconf write /org/gnome/desktop/input-sources/xkb-options “[‘caps:escape’, ‘lv3:rwin_switch’, ‘frenchonenglish:lessergreater’]” ```