Question on desktop file exec lines

Jerome Leclanche adys.wh at
Mon Jan 27 08:55:05 PST 2014

On Tue, Dec 31, 2013 at 10:23 AM, David Faure <faure at> wrote:
> On Monday 23 December 2013 09:38:02 Jerome Leclanche wrote:
>> See:
>> I think I already know the answer to both but I'd like to double-check.
>> 1) When dealing with desktop files that have %u or %U in the name, if
>> the argument is a relative file path, the file path should be made
>> absolute with getcwd(), correct?
> Yes, this is the best approach, since the app might start in a different
> working directory and therefore not find the file.
> Note that the working directory can be specified in the .desktop file, or can
> be up to the application's startup code - or the way it's started
> (cf. kdeinit and other fork-and-exec launchers).
>> 2) When dealing with %f or %F, the file path should *not* be expanded,
>> correct?
> You mean in case it's relative? The same reasoning applies IMHO.
> My code (i.e. KDE) never sends relative paths to the program started via a
> desktop file.

I thought about this a little longer and I changed my code to match yours.
This needs to be clarified in the spec. Anyone up for a patch?

J. Leclanche

> --
> David Faure, faure at,
> Working on KDE, in particular KDE Frameworks 5

More information about the xdg mailing list