Create a custom keyboard layout
Is there an easy way or an interactive tool that helps you create a custom keyboard layout? so far I think I've tried everything :
- Use a python script found on github to convert a layout made with microsoft keyboard creator into an xkb file (it didn't work)
- Try to use key Mapper
- Manually edit the xkb file of the layout using
xev
command to identify the key symbols - Try to install keyboard Layout tool (didn't work, I cannot install it )
I feel very frustrated because on windows I have a simple tool while on Linux I cannot do something so simple. I just want a tool to create a layout and then configure it
Hoping that a better answer exists and comes around, I answer here what I believe is the current state. No: there is no easy tool in Linux to create your own keyboard layout from scratch.
For changing/swapping a few keys, the tool xmodmap
was very suited. However, it is not anymore very reliable, may stop working after for example suspending the computer, etc. In addition, it will not work on Wayland, the display driver that gradually will replace the current old Xorg display server.
Editing xkb
files is, a.f.a.i.k., the only way forward here. You need to be root for this - i.e., there is no way to create a keyboard layout with user priviledges only, that only your user can see and use.
A guide is available in the official Ubuntu documentation. However, it is sparse, but it can get you started and have you quickly appreciate the complexity of the system.
To be safe when changing a keyboard layout, create a new one. Any new layout can modify existing layouts. Experimenting on a new layout rather than modifying existing ones 1) safeguards you from breaking these and 2) will be preserved upon future updates. Still, it is, if needed, possible to reset the system keyboard data by reinstalling the xkb-data
package.