3

I have a .desktop file that contains these lines:

[Desktop Entry]
Name=Firestorm
Comment=Client for Online Virtual Worlds, such as Second Life
Exec=/home/deus/Programs/Firestorm_64bit/firestorm
Icon=/home/deus/Programs/Firestorm_64bit/firestorm_icon.png
Terminal=false
Type=Application
TargetEnvironment=Unity
StartupWMClass=do-not-directly-run-firestorm-bin
Categories=Application;Network;
StartupNotify=true

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.

  • ... I don't want to run it by terminal... it doesn't run in nautilus. – Not Amused 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: http://markmail.org/message/eypvnff4bieqf5bj – 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. – Not Amused 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
  • That was the problem! Copy pasting the folder from a windows partition to the linux partition (because of re-install) probably changed the permissions for the file. So the problem wasn't the permissions of the .desktop file. It was the permissions of the executable. Thank you. – Not Amused May 27 '14 at 23:29

1 Answers1

1

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.