desktop entry spec 0.9.7 Exec key parsing
Dan Winship
danw at novell.com
Fri Nov 3 21:40:57 EET 2006
On Fri, 2006-11-03 at 10:53 -0800, Bastian, Waldo wrote:
> 1) According to the current spec Exec=foobar.sh "%f" and Exec=foobar.sh
> %f are both valid and equivalent. Unfortunately gnome adds single quotes
> 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 "foobar.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:
Exec=foobar.sh "%f"
then it means the same as if the quotes weren't there:
Exec=foobar.sh %f
but if you have a %-code inside a quoted area that includes spaces as
well, like
/bin/sh -c "foobar.sh %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
there.
Another thing possibly worth mentioning is that
Exec=foobar.sh --input=%F
is syntactically valid, but doesn't expand to what you probably want.
(KDE expands it to
foobar.sh --input=file1 file2 file3
GNOME inserts a word break before file1, which is probably a bug.)
-- Dan
More information about the xdg
mailing list