When launching an application through the command line I successfully use:

gourmet --gourmet-directory $HOME/my/custom/path/

But it does not work when trying to replicate this behaviour on a .desktop file with:

Exec=gourmet --gourmet-directory $HOME/my/custom/path/ %F 

I am probably missing something very basic here, but I cannot get my head around this. Any help would be much appreciated.

  • Can you clarify why you are using %F ? should the application open a list of files or it is just an application launcher, then you can open the files from the GUI – lese Oct 25 '15 at 21:57
  • 1
    You can make separate script-file with full command like gourmet --gourmet-directory $HOME/my/custom/path/ than put into .desktop full path to the script. – Costas Oct 25 '15 at 22:05
  • @lese, good point I actually realised %F was not required. Jodka Lemon's solution worked both with and without it. – castaway Oct 25 '15 at 23:20

Only command line options with one hyphen are possible in the Exec field.

Exec=sh -c "gourmet --gourmet-directory $HOME/my/custom/path/ %F"

should work.

  • What? This is the only possibility?? Looks like a hack. – erik Jan 7 '17 at 15:42

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.