Ubuntu – Duplicate application icons in Ubuntu dock upon launch

gnome-shelliconsubuntu-dock

I'm using Ubuntu 17.10 with GNOME shell and Numix-Circle icon theme.

When I hover over the Numix icon for Nightly Web Browser, which is pinned to the dock I get the title "Nightly Web Browser".

enter image description here

But when I launch the program, another icon pops up at the bottom, with the name "Nightly".

enter image description here

Best Answer

  • You need to add a proper StartupWMClass line to the .desktop launcher corresponding to the application (refer to this). Follow these steps:

    1. Open Files and go to your /usr/share/applications folder. Look for the "Nightly" file (i.e. the launcher for the application you want to fix) and copy it.
    2. Paste the file in ~/.local/share/applications. It should look like a file with the name <filename>.desktop.
    3. Right click on this .desktop file and open with Text Editor.
    4. Launch "Nightly" (i.e. the application you want to fix) from "Activities".
    5. Run xprop WM_CLASS in Terminal.
    6. Place the cursor over the opened "Nightly" window. The cursor should turn into a crosshair already. Click. You should get a WM_CLASS string for "Nightly" in Terminal.
    7. In the .desktop file opened in Text Editor add the following line

      StartupWMClass=OBTAINED-VALUE
      

      In place of OBTAINED-VALUE put a value you got from step 6 without any quotes.

    8. Save the .desktop file.
  • Related Question