4

I am making .desktop for teamspeak as their programmers didn't.

It ought to work for everyone and to do so I need to target home folder universaly with EXEC.

So let's pretend program X is in ~/.local

  • /home/username/.local/X this way works only for me

EDIT: This solved it for EXEC but doesn't apply to the ICON thus I placed it to /usr/share/icons which is workaround.

Tichun
  • 83
  • why did you accept an answer that does not even possibly work?? Relative paths like $HOME do not work in a .desktop file. – Jacob Vlijm Feb 20 '16 at 22:21
  • " That's not enough. See askubuntu.com/a/139198/158442 – muru Feb 19 at 19:37 " as you can see it was posted before you did comment here and I have had also already included in my EDIT.. so congratulations for writing before reading. – Tichun Feb 24 '16 at 21:20
  • I mentioned you accepted an answer before the edit was made on the answer (an edit after my comments on the answer). You should accept an answer, not including a comment in your own question. As said, you accepted a non working answer. – Jacob Vlijm Feb 24 '16 at 21:25

1 Answers1

6

You can use the environment variable HOME. It stores the absolute path to the current user's home folder.

Here's how you can use it:

Exec=/bin/sh -c "$HOME/.local/X"

It's very important putting the $ before HOME so it's read as a variable. Also do not forget write HOME in capital letters only.

Don't forget to wrap shell variable using " double quote else it will fail at execution time.

Eduardo Cola
  • 5,817