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?

  • Can you please specify how you installed Aptana? From the official site all I can see is a standalone zip file. (something like portable applications in windows). – hytromo Jan 29 '14 at 6:31
  • Yes, that was it. – malhobayyeb Jan 29 '14 at 6:41
  • So, how did it end up in /opt? Also, is it on your $PATH? How by specifying only AptanaStudio3 in your desktop file it is able to run? – hytromo Jan 29 '14 at 6:42
  • 1
    I have done it, thank you. I have created a Sym Link in /usr/bin to /opt/.../aptana It was just a mater of naming issue. I had to name the .desktop and bin and link just the same :) – malhobayyeb Jan 29 '14 at 6:44
  • 3
    Please answer in detail below how you managed to solve your problem :) (I don't know, I only asked you some questions) – hytromo Jan 29 '14 at 6:46

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
  • 3
    For those having the same issue on GNOME you can use MenuLibre: When editing the corresponding entry you will find a field for setting StatupWMClass in the list that shows up when clicking the "Advanced" button – conceptdeluxe Dec 10 '15 at 13:45
  • If someone is trying to handle an issue with mendeley executable, make sure to also edit .../bin/install-mendeley-link-handler.sh, because it overrides .desktop file on each run – MInner Nov 11 '17 at 0:26
  • 1
    TLDR; *.desktop filename = WM_CLASS(STRING) last item but lowercased. Details: I had to solve this issue while creating "Firefox Developer edition" shortcut. Naming the file "firefox.desktop" simply shadowed the standard firefox icon. Using xprop WM_CLASS and clicking the window returned WM_CLASS(STRING) = "Navigator", "Firefox Developer Edition". In the end I renamed my .desktop file as follows: mv ffde.desktop "firefox developer edition.desktop". (Another issue though, I can not right-click » addToFavorites on the icon from the gnome dock extension) – Stphane Jun 24 '18 at 10:59
  • 1
    If you don't want to / can't to modify the original .desktop file into the /usr/share/applications folder, you can copy the file to your local folder, ~/.local/share/applications, and modify the file here. So you will have a system-wide original file (probably provided by the developer/distribution) and a customized file which overrides the original file in the gnome-shell applications panel. Copying to your local folder is desirable as the file into /usr/share/applications can be reversed in the next package update. – Vinícius A. Jorge Jun 27 '18 at 22:04
  • 1
    No. Useless in Ubuntu 20 – funicorn Nov 6 '20 at 2:08


You can use StartupWMClass to group windows by class.

See this thread for additional information.

  • In addition, make sure: (1) There's no other desktop file for the same app, also in "AppEditor" or in "Main Menu". (2) Verify that Exec=/path/to/app is an absolute path. – Noam Manos Mar 30 '20 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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