0

I created a .desktop file that looks like this:

[Desktop Entry]
Name = My Script
Comment = Test
Exec= /home/zito/Documents/loc_tk.py
Icon=
Terminal=false
type=Application

I put the hashbang in the python file #!/usr/bin/env python and I also set the python file to be executable but every time I double click my .desktop file it brings up the error "There was an error launching the application".

1
  • Replace with Exec= /home/zito/Documents/python3 loc_tk.py Aug 29, 2014 at 16:08

2 Answers 2

1

Sometimes it is a small thing...

A desktop file's keyword should always start with a capital, so in this case it is:

Type=Application (Type instead of type)

it is not necessary to use python in front of the /path/to/script section in the in the Exec= line, IF you made it executable AND you have the shebang in your script

Note

if you run your desktop file on your desktop, you should make the desktop file executable as well!

1
  • Thanks that actually fixed by problem it was just a dumb typo. Aug 29, 2014 at 17:42
0
[Desktop Entry]
Name = My Script
Comment = Test
Exec= /home/zito/Documents/python loc_tk.py
Icon=
Terminal=false
type=Application

You must log in to answer this question.

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