I’ve developed an application in Qt which uses a launch script, myapp.sh. I’ve created a .desktop file which launches this script, and set:
Command: $PWD/myapp.sh
Work path: $PWD
However, $PWD prints my home directory when I launch the .desktop file, resulting in attempting to launch ~/myapp.sh rather than ~/Development/build-directory/bin/myapp.sh (that directory being where the .desktop file resides). Why isn’t it correctly setting the working directory to where the .desktop file is actually located and how can I get around this without having to specify an absolute path in the .desktop file?
$PWDholds the current working directory of the shell, which has nothing to do with the location of the .desktop file.. One way you can do this is with:From the spec,
%kis “The location of the desktop file as either a URI (if for example gotten from the vfolder system) or a local filename or empty if no location is known.” So this ismyapp.shin the same directory.