10

I've created .desktop file in ~/.local/share/applications for an application. Now I'm able to find it through Super key. But after executing the application, I can't pin it to the dock using right click -> Add to favorites. Any idea why?

1
  • Edit your question and show us the content of your .desktop file.
    – heynnema
    Dec 1, 2021 at 17:41

1 Answer 1

15

An icon that you find using the Super key can be pinned by right-clicking on it in the Applications overview.

An icon of a running application cannot be pinned if it does not have a matching . desktop launcher.

Try pinning the icon you find using Super. Then run the application. If now, you see a second icon on the dock (one that can not be pinned), then your will need to add a StartupWMClass= line to indicate the actual WMClass of the application.

To determine the WMClass of your running application, use the xprop tool as follows:

xprop WM_CLASS

If you are running standard Ubuntu on Wayland, you can determine the WMClass in the Looking Glass, "Windows" tab. You can open Looking Glass by typing lg in the Alt+F2 dialog.

3
  • So actually it works. Super key -> search -> right click -> Add to favorites is there and it works. What I was doing before (and it worked with other apps) is Super key -> search -> run the app. Then in the dock, right click on the running application and select 'Add to favorites'. Here the option is missing, if it hasn't been previously added from the 'Super key screen'. So I see there is some inconsistency in Ubuntu here. But anyway, I got what I needed. thanks.
    – TondaCZE
    Dec 2, 2021 at 10:16
  • Also I found another inconsistency, it's not the same. Normally when I run an application from the dock, a dot appears next to the icon. In this case, when I click the docked app, a new icon with a dot is created and the previous still stays there without a dot.
    – TondaCZE
    Dec 2, 2021 at 16:33
  • Sorry, I managed to displace that part. Thanks.
    – TondaCZE
    Dec 3, 2021 at 16:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .