How-to : Edit keyboard layout in Linux

Most of the time when I am writing, I am using the standard US keyboard layout. As I have to write my university homeworks or some e-mails in German I often have the irritating problem using the German keyboard layout – Y and Z letters are exchanged.

Some years ago, when I started using Linux, I found a really nice feature. There were a special kind of German keyboard layout called “German(qwerty)”. That was exactly what I was searching for. The default German layout, but Y and Z were at the “right” places. Perfect! Well this didn’t last long. Since Ubuntu 12.04 (as far as I remember) this layout was removed and was no longer available as a standard layout. But here comes the best aspect of Linux – there are no such things as “default” things. Default could be everything that the user wants 🙂 So I decided to look around and found the solution after no longer than 10 minutes – you can change the keyboard map of every layout in Linux. Here is how to do it. On the second line we

make a backup of the original layout just to be sure that we have a working backup copy of the layout.

cd /usr/share/X11/xkb/symbols/
sudo cp de de.backup
sudo vim de

There you will see the following two lines of code

german-layout

Lines 27 and 38

So the only thing that you should do now is change the places of Y and Z. Be careful, you should change both normal and capital letters. Then just save your work, log out and log in again and yes, you are ready! You have just the perfect layout that you want. Here is the layout after the changes :

layout-after-changes

Layout after the changes

As you saw, it is really easy to remap your keyboard layout. This works not only with the German layout but as well with every layout available in your Linux distribution. Playing with the map file could remap not only the alphabet characters, but the symbol ones too.

Leave a Reply

Your email address will not be published. Required fields are marked *