Show flags instead of labels in the keyboard layout language indicator in GNOME shell

Is there a way to show flags instead of labels in the language indicator in the top panel, in gnome-shell (3.28)?

I found this setting in dconf-editor: /org/gnome/libgnomekbd/indicator/show-flags But it's ineffective, nothing changes if I set that to true.

Is there a way to do this?


Solution 1:

Here is a hacky workaround.

You need to change the abbreviations of layouts (e.g. "en") shown in the keyboard layout indicator of GNOME top bar following this very detailed answer by @MathCubes.
As mentioned in the answer the <shortDescription> tags in the /usr/share/X11/xkb/rules/evdev.xml file dictate the abbreviations. Change the <shortDescription> labels associated to your chosen layouts (e.g. en) to suitable flag emojis (you can get them from Get Emoji or Emojipedia).

Since GNOME shell v3.28 supports global colour emojis, you should see coloured flags instead of labels after you reboot or re-login or restart the GNOME Shell.

Example:
enter image description here
(after replacing en by 🇬🇧 for the "English (UK)" layout)