Relative paths in .desktop files

Michael Thayer michael.thayer at
Sun May 20 13:27:17 PDT 2012

On 05/19/2012 01:20 PM, David Faure wrote:
> On Friday 24 June 2011 13:21:50 Michael Thayer wrote:
>> On Thu, 2011-06-23 at 12:47 +0200, David Faure wrote:
>>> On Thursday 23 June 2011, Michael Thayer wrote:
>>>> does [
>>>> ] look good to you?
>>> It says that "./" is relative to the location of the .desktop file. I can
>>> see the idea behind it, but then what happens when Path is set?
>>>  From an implementation point of view it's easier to chdir(Path) and then
>>> execute ./foo, but I can see how from a user point of view the idea is
>>> maybe more to say "resolve to a full path from the directory containing
>>> the .desktop file, then chdir(Path), then run the executable with a full
>>> path"?
>>> I'm talking about a case like /home/dfaure/foo.desktop saying:
>>> Exec=./foo
>>> Path=/tmp
>>> Should this do (cd /tmp ; ./foo) or (cd /tmp ; /home/dfaure/foo) ?
>>> I'm guessing the latter is more useful, but maybe less expected.
>>> (More useful because the first one can be done with Exec=/tmp/foo, since
>>> in
>>> that case we know about /tmp as an absolute path anyway).
>> I agree with what you said about the second variant being more useful.
>> In fact it seems more intuitive to me to specify all paths as absolute
>> (that is Exec too) if you really know that you are wanting to
>> run /tmp/foo.
> Agreed.
> Did anything come out of this? Should the suggested patch for the spec be
> amended to clarify the issue above?
> Any objections from main implementors to supporting "./" in Exec and Icon
> fields?
I had actually given up on this as no one with commit rights seemed to 
be inclined to make the change, and at least Marty Jack and PCMan didn't 
seem very keen on it.  I would certainly still be interested in seeing 
it though.


ORACLE Deutschland B.V. & Co. KG   Michael Thayer
Werkstrasse 24                     VirtualBox engineering
71384 Weinstadt, Germany           mailto:michael.thayer at

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven

More information about the xdg mailing list