I am creating an GTK3 python application for Ubuntu. At the moment the application installs in the following locations.

In /opt/NSTrain folder where NSTrain is the name of my application. The NSTrain folder has the executable .py files, its icons, gui files and other library files. It also installs a .desktop file to /usr/share/applications folder.

Here are the contents of my .desktop file,

[Desktop Entry]
Comment=Train Scheduler Application

I see my application in the application lens with the appropriate icon. However when I click it, nothing happens. The nstrain.py file is executable and works fine when I execute it from the terminal using ./nstrain.py command.

What is the issue here?

| improve this question | | | | |

Does your application assume you are starting it from the folder /opt/NSTrain/? If so add the line


to your .desktop file. That tells Unity (or Gnome Shell or from whatever program you are using to start your application) to start your program in the given folder.

Without that line your application gets started from the current working folder of Unity (or whatever), which usually is your home folder. That will break your application if it assumes it is started from /opt/NSTrain/ and hence tries to open a file like /opt/NSTrain/somefile.dat just as somefile.dat.

If that doesn't help please start your application in a Terminal from your home folder using /opt/NSTrain/nstrain.py and post any error messages you get.

| improve this answer | | | | |
  • Thank you very much adding Path to the desktop file fixes the issue. May I ask if you can may be expand the answer to why Path is required in this case? It might help future users. – nik90 May 21 '12 at 22:50
  • Ok, did that. Hope that helps :-) – Florian Diesch May 21 '12 at 23:22

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.