As noted by a Gentoo user here: http://forums.gentoo.org/viewtopic-p-7325644.html#7325644 the Exec line should read “ Exec=okular %U -icon %i -caption "%c" ” rather than “ Exec=okular %U %i -caption "%c" ” The current files make it so running "xdg-open /path/to/myfile.pdf" opens three windows: myfile.pdf in okular, a blank okular window titled "%c" and a pop-up window called "Error %c" that says "could not open $(pwd)/%i" (See attached screenshot) Reproducible: Always Steps to Reproduce: 1. Install okular 2. Run xdg-open /path/to/file.pdf Actual Results: Error windows appear in addition to okular window Expected Results: Only the okular window appears
After testing, this doesn't work correctly: I had to remove everything after the %U to get it to open only one window. As said in the forums, maybe the files are actually correct and need to be adapted to other window managers. In that case, I suppose this bug is invalid, yet I'll let the maintainer decide what to do about this, maybe there is value in bringing this "issue" to attention.
This should be already fixed by upstream.
I hadn't noticed the quotes (that was indeed a problem). But we are still missing the '-icon ' in front of %i. On my machine, running 'xdg-open /path/to/file.pdf' errors out (using 4.12) if I don't add that on the Exec line. Running this one-liner, as root, fixes it in the meantime: sed -r -i 's/Exec=okular %U %i -caption %c/Exec=okular %U -icon %i -caption %c/' /usr/share/applications/kde4/okular*.desktop
(In reply to Olivier Diotte from comment #3) > I hadn't noticed the quotes (that was indeed a problem). But we are still > missing the '-icon ' in front of %i. On my machine, running 'xdg-open > /path/to/file.pdf' errors out (using 4.12) if I don't add that on the Exec > line. > > Running this one-liner, as root, fixes it in the meantime: > > sed -r -i 's/Exec=okular %U %i -caption %c/Exec=okular %U -icon %i -caption > %c/' /usr/share/applications/kde4/okular*.desktop Please report this upstream, this is not distribution issue.