69

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

file: alacarte-made.desktop

[Desktop Entry]
Comment=
Terminal=false
Name=Aptana Studio 3
Exec=AptanaStudio3
Type=Application
Icon=/opt/Aptana-Studio-3/icon.xpm

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?

pomsky
  • 70,557
malhobayyeb
  • 1,522

4 Answers4

104

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
Greeso
  • 135
4

StartupWMClass

You can use StartupWMClass to group windows by class.

See this thread for additional information.

earthmeLon
  • 11,658
0

I'm using Ubuntu 22.04.1 LTS and I installed Firefox Developer Edition Version=109.0

I came up with same problem, Here I paste my .desktop code,

Before (Wrong):-

[Desktop Entry]
Encoding=UTF-8
Name=Mozilla Firefox
GenericName=Web Browser
Comment=Firefox Developer Edition
Exec=/opt/firefox/firefox
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
StartupNotify=True
X-GNOME-Autostart-enabled=false
Version=109.0

After (Working):-

[Desktop Entry]
Encoding=UTF-8
Name=Mozilla Firefox
GenericName=Web Browser
Comment=Firefox Developer Edition
Exec=/opt/firefox/firefox
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
StartupNotify=True
X-GNOME-Autostart-enabled=false
Version=109.0
StartupWMClass=firefox-aurora

Now its working correctly.

Hint:-

I tried all the above answers before posting my answer(this),

  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.

When I run xprop WM_CLASS , I can't see any output as mentioned in those answers.

Then how do I solve this?

When I mouse over the additional app icon in taskbar, It displayed firefox-aurora

I just read the application.ini file from firefox installation folder and found RemotingName=firefox-aurora so I copied firefox-aurora name to StartupWMClass=firefox-aurora

In place of firefox-aurora I also tried firefox (because its the executable file name), but it didn't work for me.

-2

I faced this issue when I manually installed Spring Tool Suite 4

Then, after install, I created STS.desktop in following folder of Ubuntu 20