5

I made a .desktop file for a PyQt5 App, it does show the icon on the desktop, but when I open it and starts running, the icon is not showed in the taskbar, instead there is a gear icon. Thanks for your help

.desktop file:

[Desktop Entry]
StartupWMClass=esmeralda_suites.py
Version=1.0
Type=Application
Name=Esmeralda Software
Comment=
Exec='/home/cattivellio/Documents/Esmeralda BETA 9/esmeralda_suites.py'
Icon=/home/cattivellio/Documents/Esmeralda BETA 9/img/minilogo.png
Path=/home/cattivellio/Documents/Esmeralda BETA 9
Terminal=false
StartupNotify=true

desktop screenshot

Cattivellio
  • 51
  • 1
  • 4

3 Answers3

7

You will need to specify the correct wmclass in the `.desktop launcher.

  • Look up the wmclass for your window: for the standard Ubuntu desktop, open the run dialog (lt+F2) while the app is running. Type lg followed by Enter, and look up the wmclass of the app in the list.

  • Then add or edit the key StartupWMClass in the `.desktop launcher such that it mentions the correct wmclass.

    StartupWMClass=<wmclass>
    
vanadium
  • 97,564
0

The first answer is correct if it is showing no icon. However, if you are seeing a gear, look somewhere else in your Applications View, and you will likely find a gear icon with a similar name.

When you launch from the Applications View it is somehow loading that gear icon .desktop entry instead. Find that .desktop entry, probably in /usr/share/applications, remove it, make sure you follow the setup instructions above, and it will work.

0

Your launcher file (.desktop) is missing the StartupWMClass entry. First locate your desktop file. It's likely in

  • ~/.local/share/applications OR
  • /usr/share/applications (need sudo access for this)

Use looking glass (Alt+F2 and then type lg) to find the WM Class for your application (you can try launching the application after you started looking glass to easily identify the new entry. Close looking glass using the Esc key.

Now edit your .desktop file and add a line StartupWMClass=info from looking glass as is without quotes

In a couple of instances, I had to also remove the executable permission from the file (chmod -x app.desktop) and then add it back (chmod +x app.desktop). But I am myself not convinced about this. Most likely this might have caused some refresh or something. Writing it here only as another thing to try.

Hopefully that works. Best of luck.