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

The file content is:

[Desktop Entry]
#Icon=connect-data-space
Icon=XCloud
Categories=Utility;
Type=Application
#Exec=/usr/share/ConnectDataSpace/appl/launcher.sh
Exec=/usr/share/XCloud/appl/launcher.sh
Name[en_US]=Connect Data Space
#Name=Connect Data Space
Name=XCloud
Comment[en_US]=
Comment=
StartupNotify=true
Terminal=false
OnlyShowIn=GNOME;Unity;
StartupWMClass=ConnectDataSpace
Actions=CheckUpgrade

[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
OnlyShowIn=GNOME;Unity;

What exactly represent the StartupWMClass field of this file?

Tnx

Andrea

up vote 70 down vote accepted

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.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.