I am using pygame right now to learn about it. When i first executed the program file from terminal ; there was an icon of the program window. I locked it to launcher and it used to run my program; each time i clicked on it.

But when i changed the location of that python file; the icon was still there ( in the launcher) and when i tried to make a new icon for my new program; the previous icon was coming and it was doing nothing on clicks.

Any ideas?

  • 1
    Remove the corresponding .desktop file from ~/.local/share/applications and repeat the routine, or edit the file to point to the new location. Sep 11, 2018 at 19:12
  • @JacobVlijm ThankYou so much. :))))
    – Vicrobot
    Sep 11, 2018 at 19:14

1 Answer 1


What happened?

If you launch a GUI application from the terminal, the possible corresponding .desktop file is looked up as the application's representative in the launcher.
The priority to look up then is:

  1. ~/.local/share/applications
  2. /usr/share/applications

If in neither of these directories a valid representative is found, the application appears in the launcher with a generic icon. Right-clicking the icon and choosing Lock to Launcher, as you did, will then create a .desktop file in [1].

This .desktop file includes the full command + path you ran the application with, in theExec= -line.

How to fix if you moved the application?

Simply either:

  • Delete the (.desktop) file from ~/.local/share/applications, run your application again from cli and lock it again to the launcher.


  • Open the representing .desktop file in ~/.local/share/applications with e.g. gedit

    gedit ~/.local/share/applications/<.desktop_file>

    and change the line, starting with Exec= to represent the application in the correct path.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.