xdg-open causes an error unless there is "-icon" in front of %i in the .desktop files (contrary to spec, see https://bugs.kde.org/show_bug.cgi?id=326711#c1). Tested with 1.1.0-rc1 and 1.1.0-rc2.
I cannot reproduce this error on kde (fedora 20) using xdg-utils-1.1.0-rc2
runs okular without error for me.
What desktop environment are you using?
I'm going to guess that the "generic" code path is hitting here, I think that's the only one that tries to parse .desktop files
(In reply to comment #1)
> I cannot reproduce this error on kde (fedora 20) using xdg-utils-1.1.0-rc2
> In short,
> xdg-open foo.pdf
> runs okular without error for me.
> What desktop environment are you using?
I am using wmii that I start manually with 'startx', so yes, generic.
Here is the result of 'env | grep -i XDG':
XDG_SESSION_COOKIE=[redacted since I have no idea if this is sensitive information]
Created attachment 107754 [details]
Patch adding crude handling of %i and %c
I think I have found the problem:
In the function search_desktop_file() of xdg-open, only %[fFuU] is handled. %i should be replaced by --icon <value of Icon key here>.
Attached is a patch that seems to work for that (and, as a bonus also replaces %c by the name, although it should technically replace it by the Name[<correct language>]).
I have tested with bash and bash in 'sh mode'. checkbashisms also doesn't complain.
Created attachment 114180 [details] [review]
Improved patch to handle multi-word Names like "Mozilla Firefox"
I just realized that my patch caused issues with Firefox. Better late than never I guess.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/71.