Enabling the " Keyboard Layout " indicator with country flags

So as the name says I will tell you how to switch to the flag version of the keyboard layout indicator.

At first you will need png images for the flags . Download the flags for your layouts .
Open gimp and rescale them to 26x10 (width x height). Rename them to your layout language
like for US layout rename the image as "us.png" , for Russian rename to ru.png and etc.
Then put them in ~/.icons/flags .
After that install dconf-editor (if not installed). Open dconf-editor and go to
org/mate/desktop/peripherals/keyboard/indicator and check the "show-flags" option .


This is brilliant and much needed!

Which is this not integrated into the MATE desktop by default?

Well it is :smiley: . The option is just not included in the keyboard preferences , for a unknown reason . Maybe 'couse most of the icon themes don’t have country flags in them .The function dates back to gnome 2.X as I remember and gnome-flashback has it too .

Well, shouldn’t the distribution provide those flags?

It’s not very user-friendly to expect them to manually add their flag icons somewhere. Don’t you think? :slight_smile:

And once I add the flags, how do I start the keyboard indicator?

Well it’s not the distribution thing to provide these flags . It’s the developers .

Thats the esiest way . The flags are a feature of default tray indicator.

Who is the developer in this case?

Let’s get in touch with them! :slight_smile:

Simply as https://github.com/mate-desktop/libmatekbd . The Mate desktop team .

1 Like

Cool, thanks!

As far as I can see they are already working on this?

To set this from terminal on Ubuntu MATE 18.04 LTS we need one simple command

gsettings set org.mate.peripherals-keyboard-xkb.indicator show-flags true

Also posted this solution on AskUbuntu for better visibility :slight_smile:

But it does not work on Ubuntu MATE 16.04 LTS out-the-box. It shows GTK_STOCK_STOP icon ().
I reported bug 1783543 to launchpad. Copying flags to ~/.icons/flags or upgrading to MATE 1.16 from xenial-mate PPA solves the problem.

This seems to no longer work in 22.04 - no more flags - only a little square with initial letters indicating the language of the keyboard

I can't reproduce this, I see the flags.
Tested on freshly installed Ubuntu MATE 22.04 LTS with default Yaru-MATE-light theme.

Very strange... Perhaps it's because I migrated old settings from previous installation? Is there a way I can manually delete the settings file for the language indicator?

Probably you can try to run

dconf reset -f /org/mate/peripherals-keyboard-xkb/indicator

and then try to switch themes if problem persists.

There are two different keyboard indicators. I attach screenshots of both indicators shown side by side (probably a bug).

The discussed dconf key is related to the old one. It displays text or a flag icon. @nicolaigideon is probably referring to the new one from Ayatana project. It displays icons from icon theme, but these isons are basically SVG files with text.

1 Like

This ayatana-indicator-keyboard is disabled by default on Ubuntu MATE 22.04 LTS installation. It is less functional.

1 Like

Thanks for letting me know that @Norbert_X ! It's a test installation, I may have enabled it somehow during experiments. Unfortunately, I have no Discord account to check the reference.