Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I have a .desktop file that contains these lines:

[Desktop Entry]
Comment=Client for Online Virtual Worlds, such as Second Life

I just re-installed Ubuntu 14.04 before the reinstall this file worked just fine. Now it doesn't. I did set the exec property.

When I run it from terminal I get this:

deus@xxx:~/DesktopShortcuts$ ./firestorm.desktop 
./firestorm.desktop: line 1: [Desktop: command not found
./firestorm.desktop: line 3: for: command not found
./firestorm.desktop: line 10: Network: command not found

Can anyone tell me what the problem is and how to fix it?

Thank you.

share|improve this question

marked as duplicate by BuZZ-dEE, chaos, nux, Vojtech Trefny, Eric Carvalho May 28 '14 at 12:09

This question was marked as an exact duplicate of an existing question.

... I don't want to run it by terminal... it doesn't run in nautilus. – Deus Deceit May 27 '14 at 20:13
OK, you didn't mention that. The only example usage I see is trying to run it from a terminal. Do the files that the .desktop is referencing exist? (/home/deus/Programs/Firestorm_64bit/firestorm, /home/deus/Programs/Firestorm_64bit/firestorm_icon.png). You could also try removing or commenting out the lines that start with TargetEnvironment= (I don't see this one here) and maybe StartupWMClass=. – Chuck R May 27 '14 at 20:23
Here is something else referring to how TargetEnvironment= is deprecated (and may, in fact, be removed from the source, which would break any .desktop files using it) and OnlyShowIn=Unity should be used instead: – Chuck R May 27 '14 at 20:26
@Githlar... Since we're talking about .desktop files, it's only natural to run them through the desktop. The reason I tried command line was to see what was the error. And show it to this forum. I did the change you suggested but nothing changed. Also I mentioned that it worked before I re-install Ubuntu 14.04. The same file. I also checked the paths just in case, they are correct. – Deus Deceit May 27 '14 at 21:39
If you try to manually run the command that the .desktop launches, does it work? /home/deus/Programs/Firestorm_64bit/firestorm – Chuck R May 27 '14 at 23:07

You can't open a desktop shortcut as an script, because the shell won't understand the command and it'll just try to execute line by line what's in the text file.

Try this:

gnome-open firestorm.desktop

If it doesn't work, it may be a problem of permissions. Try to do the file executable with:

chmod +x firestorm.desktop

or trought the properties menu that appears if you right click on the desktop file.

share|improve this answer
I did what you said and it just opens the file as text file with gedit. – Deus Deceit May 27 '14 at 20:03
Try with nautilus after you give it execute permissions. – darent May 27 '14 at 20:33
If you can see the icon of your program in Nautilus, darent's solution should work – Sylvain Pineau May 27 '14 at 20:36

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