Set Custom Flags for XFCE4 Keyboard Layout Plugin

XFCE4 is one of the best desktop environments available for Linux these days. It is solid, lightweight and feature rich. It includes a lot of really useful and great apps. In this article, I would like to show you how to set custom flags for the keyboard layout plugin in XFCE4.


In XFCE4, there is a plugin for the panel (Taskbar) which indicates the current keyboard layout. It can display an image (a country flag) or a text label in the panel to show the current keyboard layout. Another useful feature of the plugin is the ability to maintain the keyboard layout per app window or globally for all running apps.

As you may already know, there is a migration plan by the XFCE4 project to move the Desktop Environment to GTK+ 3. One by one, apps and plugins are being rewritten using GTK+ 3. After the xfce4-terminal, the xfce4-xkb-plugin has reached version 0.8. Besides the GTK+ 3 toolkit, the plugin also got plenty of other improvements.

XFCE4 Xkb Plugin About

One of its new features is the ability to load custom flags from the user's home directory without replacing files in /usr/share/xfce4/xkb/flags directory. It was one of the long awaited features. For example, you can set a custom zoom level for the flag image (widget size)!

XFCE4 Xkb Plugin Options

Isn't this great?

So, if your distro got the updated xfce4-xkb-plugin 0.8.x or if you have compiled it yourself, here is how you can use the custom set of flags with your XFCE4 plugin.

To set custom flags for XFCE4 keyboard layout plugin, you need to do the following.

  1. Grab a nice set of flags in the SVG format. For example, I will refer to Wikipedia and use the following flags.
    For English keyboard layout: Nuvola USA flag
    For Russian keyboard layout: Nuvola Russian flag
    See the following screenshot:
    XFCE4 Xkb Plugin Custom Flags
  2. With your favorite file manager, create the following directory structure:
    /home/your user name/.local/share/xfce4/xkb/flags

    You can save your time by opening a new terminal instance and typing the following command:

    mkdir -p ~/.local/share/xfce4/xkb/flags/

    This will create all the required directories at once.XFCE4 Xkb Plugin Flags Dir

  3. Name your SVG files using the naming scheme used in the /usr/share/xfce4/xkb/flags folder. For example, you have to save your USA flag as us.svg and your Russian flag as ru.svg.
  4. Finally, remove the Keyboard Layouts plugin from the panel and add it again. Alternatively, sign out and sign in to your user account. As of this writing, the plugin doesn't load flags on-the-fly.

Voila, you just applied custom flag images to the Keyboard Layout plugin of XFCE4.

XFCE4 Xkb Plugin Custom Flags Loaded

It is always nice to see these little (and major) improvements in XFCE4. These days, it is the only Desktop Environment in Linux that I can stand. It is not bloated, and is stable and useful.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!


Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Leave a Reply

Your email address will not be published.

Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.