I am working on this pre-existent .desktop file and I have a doubt:

The file content is:

[Desktop Entry]
Name[en_US]=Connect Data Space
#Name=Connect Data Space

[Desktop Action CheckUpgrade]
Name=Verifica Aggiornamenti
#Exec=java -jar /usr/share/ConnectDataSpace/appl/lib/shellExtBridge.jar -checkupgrade
Exec=java -jar /usr/share/XCloud/appl/lib/shellExtBridge.jar -checkupgrade

What exactly does the StartupWMClass field of this file represent?

3 Answers 3


Modern Linux desktop environments (Gnome 3, Ubuntu Unity, Docky) use the WMClass property to associate windows with the owning application. Many Java-based applications have the problem where the windows created by the application are not associated with the shortcut used to start the application (so the dock contains multiple copies of the same icon).

So the field called StartupWMClass is a string that defines in which class the application is grouped in the Unity Launcher at startup.

You can find out which WM_CLASS your window has got when you type in a terminal:

xprop WM_CLASS

and then click at the window. In case of the gnome terminal the output is as follows:

WM_CLASS(STRING) = "gnome-terminal", "Gnome-terminal"

So all windows with WM_CLASS "gnome-terminal" and "Gnome-terminal" are grouped together.

  • 7
    I find useful to link to official FreeDesktop specifications page, though it does not add a lot of info: standards.freedesktop.org/desktop-entry-spec/latest/…
    – Stefano
    Jun 23, 2014 at 7:00
  • 3
    More to the answer: don't use quotation in the value of the desktop file.
    – joker
    Jun 16, 2019 at 17:15
  • For clarity: this setting won't have any effect on what WM_CLASS is, it just tells the launcher what class it should expect the launched application to have. If the application really does have that class, it will be grouped under the launcher icon made from this .desktop file.
    – Tgr
    Jan 8, 2023 at 23:54
  • 2
    Also note that this is an X11 concept. Ubuntu 22+ uses Wayland by default, which doesn't really use WM_CLASS so not sure this setting will have any effect.
    – Tgr
    Jan 8, 2023 at 23:55
  • @Tgr It has effects at least for Xampp installation
    – Zatigem
    Jul 9, 2023 at 20:23

On newer systems with Wayland, xprop tool won't work anymore.

If you are using GNOME Shell, you can use a built-in tool Looking Glass.

Press Alt + F2, type lg and press Enter. In the top-right panel, select "Windows".

The WM_CLASS will be displayed under the wmclass key.

For example: enter image description here


On a side note, notice that under Kde/Kwin and wayland, xprop won't work.

You'll have to use qdbus org.kde.KWin /KWin queryWindowInfo and click on the window you want to observe.

WMClass will be in the resourceClass attribute.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .