Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 28 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.

share|improve this answer
    
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/… – Pisu Jun 23 '14 at 7:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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