Ubuntu – Duplicate icons for manually created GNOME launcher items


I have downloaded Aptana Studio 3 and created the following launcher item for using Alacarte:

file: alacarte-made.desktop

[Desktop Entry]
Name=Aptana Studio 3

Then, when I add the icon to the favorites and opens the Aptana Studio 3 I get two icons for it, one for launching new instances, and one for the currently running instance as per the following screenshot:

enter image description here

How do I force the application to use the same icon added to the favorites?

Best Answer

To save sifting through the thread mentioned by @earthmeLon, you need to do the following:

  1. Launch the application
  2. Fire up a terminal and run xprop WM_CLASS. Click on the window of the the application that is running with a duplicate icon.
  3. You'll get some output like WM_CLASS(STRING) = "Navigator", "Firefox". Choose one of the classes, eg Firefox in this example
  4. Add the class as the value of StartupWMClass in the .desktop file. For example, StartupWMClass=Firefox
  5. Save the .desktop file, close the application and re-open it. There should now only be 1 icon in the launcher
Related Question