Ubuntu – .Desktop EXEC universal home path

desktophome-directory

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.

Best Answer

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.

Related Question