Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a command with a working .desktop Exec key as follows:

Exec=env XDG_CONFIG_HOME=/home/bean/.config/gedit/ gedit %U

I would like to use the $HOME variable instead and it works in the terminal but not when used in the .desktop file. Please correct me if I'm wrong, but I assume this is because of improper "escape characters".

I have tried numerous variations of the command with \ and {} but to no avail. After looking around I'm not even sure if what I want can be accomplished.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

There are no special characters there that you would need to escape, so no it's not an escaping issue. I just read through the freedesktop.org .desktop file specification and it does not explicitly mention environment variables, neither to allow nor disallow them. Nevertheless, neither $HOME nor ~ seem to be expanded in the exec field of a .desktop file.

So, it looks like what you're attempting is not possible.

share|improve this answer
    
Thank you, @terdon. I have been looking through examples of how other applications do it and they all seem to use absolute paths in the exec field. –  beanaroo Mar 6 at 23:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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