2

This appears to be the same question as How to add launcher icon for python script? but the solution given there doesn't seem to work for me. I have an executable tkinter script for which I have made a desktop launcher. The launcher is

[Desktop Entry]
Version=1.0
Type=Application
Name=Free Cell
Exec=./freecell.pyw
Icon=applications-cardgames
Path=/home/saul/Projects/PythonProjects/freeCell
Terminal=false
StartupWMClass=Freecell

The call to tkinter.Tk is self.root = root = tk.Tk(className='Freecell')

When I execute xprop WM_CLASS and click on the window of the running app, I get

WM_CLASS(STRING) = "freecell", "Freecell"

but the icon on the window button in the panel is just a blank square. The icon shows up on the desktop fine, so that isn't the problem.

I've tried chaing the last line of the .desktop file to StartupWMClass=freecell, as recommended in this answer, but the behavior was identical.

I'm using Xubuntu 20.04.

Part of my problem may be that I don't really understand what's going on, I'm just trying to follow the recipe. While I'll be grateful if up can tell me how to fix the problem, I'd appreciate an explanation of what's happening.

4
  • applications-cardgames is not an icon, but you can make it one with xdg-icon-resource install <path to icon file or png or svg> <make this applications-cardgames or any other name>
    – lnee
    Apr 6 at 18:18
  • @Inee Thanks. I'll try that, but I don't understand. I right-clicked on the desktop, clicked "create launcher" and picked an icon from the selections I was shown. I've just edited the desktop file that was created.
    – saulspatz
    Apr 6 at 19:43
  • or you cloud just replace applications-cardgames with a path to a image file
    – lnee
    Apr 6 at 19:49
  • A similar issue in GitHub, and its fix Apr 7 at 9:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.