PATCH: desktop entry spec 0.9.7 Exec key parsing

Bastian, Waldo waldo.bastian at
Mon Nov 13 20:37:30 EET 2006

>On Fri, 2006-11-03 at 10:53 -0800, Bastian, Waldo wrote:
>> 1) According to the current spec "%f" and
>> %f are both valid and equivalent. Unfortunately gnome adds single
>> around the filepath when using "%f" effectively making the path
>> unusable. The bright side is that such quotes are useful when doing
>> Exec=/bin/sh " %f". Please advice how we can capture this in
>> the spec.
>How about if you have a % code inside quotes, but there are no spaces
>inside the quotes as well, like in:
> "%f"
>then it means the same as if the quotes weren't there:
> %f
>but if you have a %-code inside a quoted area that includes spaces as
>well, like
>   /bin/sh -c " %f"
>then you have to requote it inside the quotes.
>Either that or just don't allow the second case, and say that if a %
>code is inside quotes, it has to be the only thing in that set of
>quotes, and the behavior is exactly the same as if the quotes weren't

I'm inclined to disallow both cases because both are currently treated
different between Gnome and KDE and without a strong commitment to make
changes to the existing implementations I don't think it makes sense to
specify anything else in the spec.

>Another thing possibly worth mentioning is that
> --input=%F
>is syntactically valid, but doesn't expand to what you probably want.
>(KDE expands it to
> --input=file1 file2 file3
>GNOME inserts a word break before file1, which is probably a bug.)

Yes, I don't think it makes sense to use %F or %U other than as a
stand-alone argument.

So please review the attached patch, it makes the following changes:

* Clearify that %U may result in either local paths or file: URLs

* Deprecate %d, %n, %D and %N. They aren't usable on Gnome and you can
do the same with dirname and basename in a script.

* Clearify that %f, %u, %F or %U should only be used once.

* Clearify that these codes should be ignored if there is no file to

* Clearify that %f may be assumed if none is specified.

* Forbid the use of field codes in quoted arguments.

* Clearify that %F and %U should only be used as a stand alone argument.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: desktop_entry_exec.patch
Type: application/octet-stream
Size: 3321 bytes
Desc: desktop_entry_exec.patch
Url : 
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the xdg mailing list