0

Changed some names to be more accurate.

I have an app that I can run from terminal. The app exists in a folder in my home directory named ZereneStacker. The name of the app is also ZereneStacker. Right now, I only know how to run it from terminal and I do that like this.

cd ZereneStacker
./ZereneStacker.bsh

It runs fine this way.

I created a .desktop file in /usr/share/applications and named it zerene.desktop. I made it executable. Here is the contents of zerene.desktop:

[Desktop Entry]
Version=1.0
Name=Zerene Focus Stacker
Comment=Focus Stacker
GenericName=Focus Stacker
Exec=./ZereneStacker.bsh
Path=~/ZereneStacker
Terminal=false
Type=Application
Categories=Photography
StartupNotify=true

I stole most of this from another working .desktop file. When I try and click on the icon in /usr/share/applications, I get "There was an error launching this application". Since I know it loads fine when I do it form the terminal command line as outlined above, I know the problem is with what I did and not the program.

Sorry I tried to be generic in the original message to "simplify" only to have that backfire on me now.

David Foerster
  • 36,890
  • 56
  • 97
  • 151

1 Answers1

1

The Path key of a Desktop Entry File doesn't perform tilde expansion or any other form of shell expansion. You need to specify an absolute path that will be interpreted verbatim until the next line break character, e. g.:

Path=/home/charlie/ZereneStacker

This is probably what you want because the application directory is only in your home directory, not in every user's home directory. For the same reason it may also make more sense to put the desktop entry file in ~/.local/share/applications because that's where user-specific desktop entries reside (instead of the system-wide locations /usr/share/applications and /usr/local/share/applications).

Alternatively you can remove the Path key of invoke a shell from the Exec key of and have it expand the tilde:

Exec=/bin/sh -c "cd ~/ZereneStacker && exec ./ZereneStacker.bsh"
David Foerster
  • 36,890
  • 56
  • 97
  • 151