0

So I have an executable in a directory in my Downloads folder. In that same folder is an icon and a .desktop file for the application. Thus, I was able to pin the icon to my dock. Great!

When I click the application, it spawns off a new process below that dividing line that separates running applications or not. Most of my applications don't spawn an extra window, you get that red dot underneath it and you just access the application using the icon on the dock. This new application is that familiar gear-icon we all know about: https://i.imgur.com/mxkerEQ.png

Instead of the icon specified in the .desktop file. Here is what the original .desktop file looked like:

[Desktop Entry]
Name=(application name)
Exec=AppRun
Icon=icon
Type=Application
Categories=GTK;GNOME;Utility;

As for what I've tried, I added these lines that weren't there before, with no change in behavior:

Terminal=false
Actions=quit;
DBusActivatable=true
SingleMainWindow=true
X-GNOME-UsesNotifications=true
X-GNOME-SingleWindow=true
Hidden=true

I tried doing some research into Window manager classes but figured I was getting into dangerous territory. I have found questions already about dash icons, but none when it's running and it's below the separation line of the dock.

Any way to make the spawned-off executable's icon match the original? Or make it so when I click the icon on the dock, it doesn't spawn off a new process.

=== Still same result after trying what was suggested below.

Here's the lg output: lg output

And here's the .desktop file: desktop file

Could it also be on the part of the writers of the executable?

1 Answers1

0

An icon on the dock is generated based of the information included in a little file with extension .desktop, an application launcher.

The system associates a running window with such application launcher based on the class of the window, the wmclass property. Sometimes, the wmclass of a window is not what the desktop environment expects based on the application launcher. In that case, the connection between the application launcher and the running application is lost. Then, the desktop environment shows a default generic icon instead.

This can be remedied by explicitly mentioning the wmclass of the application in the .desktop launcher.

The icon of a running application may not correspond with a pinned icon on the dock if the wmclass of the window does not match what the system expects based on the information in the launcher.

  1. Find the wmclass of the running application. Start the application, and then, in the standard Ubuntu desktop, open the looking glass (hit Alt+F2, then type lg then Enter), and on the Windows tab, take note of the wmclass property of your window. Suppose it is myapplication. In desktop environments running on Xorg, xprop can be used to find the wmclass.
  2. In the .desktop launcher of the application, in the [Desktop Entry] section, add a line
    StartupWMClass=myapplication
    

Next time you launch the application, it should remain associated with the pinned icon.

vanadium
  • 97,564