https://bugs.kde.org/show_bug.cgi?id=522017

Joshua Prince <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Joshua Prince <[email protected]> ---
I see the same behavior. The service menu seems to append the file you clicked
on to the end of the "Exec=" line, but it only happens if there is no %u or %U
in the "Exec=" line.

So your line:
  Exec=xdg-open "/my/path/to/myffmpeg-help.md"
becomes
  Exec=xdg-open "/my/path/to/myffmpeg-help.md" "/path/to/the/file/you/clicked"

My fix was to change the line to
  Exec=xdg-open "/my/path/to/myffmpeg-help.md" #
(with "#" at the end). The hash comes before the appended file name and turns
the name into a comment, so the command ignores it.

Also, FYI, if you select 2 or more files and use this service menu, the Exec
line runs once per file. You probably don't want to open N windows on a single
click. Since you're not using the file name, you can "trick" the system into
only running xdg-open once:
  Exec=xdg-open "/my/path/to/myffmpeg-help.md" #%U
A "%U" anywhere in the Exec line tells the runner that the command supports
multiple path arguments in a single execution. This version expands all the
paths after the comment, so they are ignored, but the command only runs once.

Maybe there's a better way to indicate that we don't want the selected path
appended at all?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to