0

I've created this launcher that executes a shell:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Exec=/full/path/server.sh
Name=MServer
Comment=foo
Icon=gnome-sudoku

I need it to execute a relative path because I don't know the full path:

Exec=server.sh

But the code above with relative path doesn't work. How can I execute from the relative path?

0

The post @FedonKadifeli has suggested helped me.

The possible solution can be:

Exec=sh -e -c "exec \\"\\$(dirname \\"\\$0\\")/.sh/server.sh\\";$SHELL" %k

Explaining the command:

The snippet below will get the dir name of who is executing that, therefore the launcher dir name

$(dirname \\"\\$0\\")

So appending the desired path, will make this execute relative path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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