The keyboard layout indicator in GNOME, which appears in the panel after adding more than one layouts, shows preassigned abbreviations for layouts. Is there a way to rename this abbreviations? For example I want to change en to Eng here:
If I'm not mistaken it can be done pretty easily in KDE.
Distro: Ubuntu GNOME 17.04
This method only works with Xorg*
(* Update from the original asker: It seems the changes made in an Xorg session persist after rebooting to a Wayland session.)
Introduction
Basically, GNOME-Shell seem to be obtaining the abbreviations of the keyboard layouts from a configuration file (
/usr/share/X11/xkb/rules/evdev.xml
). So to change them, we first need to open the configuration file in a text editor and then change them to whatever we want!There are two different ways to do it. Though the graphical interface which includes the mouse or the command line interface which is only the keyboard.
Common first step
First open a terminal.
There is many way to do this. This method is the simplistic. Press Alt + F2 on your keyboard. You will see a dialog box come up and type in
gnome-terminal
or the name of your terminal. It should look like this now.Now, press Enter. It should close and bring up an terminal.
Form here there are two ways: First the graphical way, or the Command interface.
Graphical Method
Now type in
This is how it should look.
Now, press Enter and it should open the file in which we need to edit. This is how it should look:
Now click on the bottom with the three dots. Highlighted in blue, then find and click on "Find and Replace..." Highlighted in lighter gray.
Now it should bring up an dialog
Now we can edit this file to change "en" to "Eng". This will change all of the layouts that uses "en"
Now, type into the text-box with "Find" to the left of it with this
<shortDescription>en</shortDescription>
Next, with the textbook below it and text to the left that says "Replace with", type this in it<shortDescription>Eng</shortDescription>
. Now it should look like this.However, if you only want to change one layout then you will need to find it individually instead of changing all of them. I would just used the Find function to search for the name of it which needs to be spell exactly to find it.
Now click on the button that says "Replace all" now that dialog box should disappeared with it saying it's found and replace 9 or so occurrences.
Now save it by clicking on the save button highlighted in light gray.
Now, notice that the asterisk in the title should go away like this. If it didn't then it didn't save.
Restart your PC. Now it should look like this. Notice, that I did it with "eng" instead of "Eng"
Command line interface
Type in
Press Enter on your keyboard.
Type in your password.
Press Enter on your keyboard.
Restart your PC.