Bug 214400

Summary: klipper actions should offer opening in PDF-viewers when http-link point to PDF
Product: [Plasma] plasmashell Reporter: m.wege
Component: Clipboard widget & pop-upAssignee: Esben Mose Hansen <kde>
Status: RESOLVED INTENTIONAL    
Severity: wishlist CC: dimsuz, hr.denzler
Priority: NOR    
Version First Reported In: 5.15.3   
Target Milestone: 1.0   
Platform: Ubuntu   
OS: Unspecified   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Execute Action Shell Script for Klipper
Trippelclick a line example

Description m.wege 2009-11-13 15:15:12 UTC
Version:            (using KDE 4.3.3)
Installed from:    Ubuntu Packages

When I copy a link to Clipboard which points to a pdf-file, Klipper actions only offer browsers and not PDF-viewers. It would great, if this would be corrected. I assume the problems also occurs when the link points to other file-types like odf,rtf, odt, ... But I have not tried.
Comment 1 Dmitry Suzdalev 2009-11-13 15:24:04 UTC
Well, automatic mimetype detection wasn't enabled for remote urls for a specific reason: in some situations it can take a looong time (for example if server is unresponsive or a connection is slow). And this would make klipper freeze.

As a workaround you can add a simple custom action yourself. Something like:

^https?.+pdf$ => and specify a program you want to open file with.
Comment 2 m.wege 2009-11-13 22:53:02 UTC
I understand, but I would not expect mime-type detection anyway. If I understand it right, this wold mean quering the server? Offering the actions by the ending of the filenames would be enough. Thanks for showing an example for a work around. I think klipper should include those actions, because the average user is not able to create them.
Comment 3 Esben Mose Hansen 2009-11-14 09:52:08 UTC
I have planned "GetHowNewStuff" to enable upload and download of stuff like this. And I plan to ship with some more defaults, at least as examples. But it won't make it to 4.5, I fear.
Comment 4 Esben Mose Hansen 2009-11-14 09:52:33 UTC
eh, make it *before* 4.5, of course.
Comment 5 m.wege 2009-11-20 14:48:44 UTC
I have just been looking and playing around. In Konqueror the context-menu presents "Open with" -> Okular, ... when in right click on a link containing a PDF. So either Konqueror does use automatic mime detection and risks freezing here too, if the server is unresponsive or it only decides what to present by the endings. I would assume the later, since the open with appears in the same way, if there is no network connection. So may be you could do it the same way as konqueror does there?
Furthermore I just tried to create some custom actions. I went to the Wikipedia-Site and it seems pretty hard. Of course it will be easiert with examples. But then I had another idea. May be Klipper could just adopt the Service-Menus from Konqueror and Dolphin. There are already many of them, some of them could be also useful in Klipper. Klipper could then just add a manager for turning service-menus on and off for the use with Klipper.
Finally a question about the above example with the pdf-file:
I finally made it work like this ^https?://.+pdf . Is there the possibillity to add ftp, ftps, sftp to that above example? I read the wikipedia page, but I could not figure about how to say "or" (^https?|ftps?)://.+pdf did not work.
Comment 6 Hans-Rudi Denzler 2010-02-02 11:40:49 UTC
One can add the following action in .kde4/share/config/klipperrc
Description=Execute
Regexp=^cmd://.

Commandline[$e]=cmd %s
Description=cmd 'cmd://COMMAND [OPTION | ARG]... [FILE]...'
Icon=application-x-shellscript

The file cmd is linked to /home/.../bin/ to be in the $PATH.
Examples:
cmd://gvim cmd  --- opens file cmd in gvim
cmd://kmail --view FILE   -opens FILE in kmail
cmd://kontact --module korganizerplugin
cmd://okular http://www.novell.com/documentation/opensuse112/pdfdoc/art_osuse_installquick_112/art_osuse_installquick_112.pdf
Comment 7 Hans-Rudi Denzler 2010-02-02 11:45:18 UTC
Created attachment 40455 [details]
Execute Action Shell Script for Klipper

must be linked to $PATH
Comment 8 Hans-Rudi Denzler 2010-02-02 11:52:01 UTC
Created attachment 40456 [details]
Trippelclick a line example
Comment 9 Nate Graham 2023-05-17 00:33:11 UTC
It's a cool idea, but given the lack of movement for so long, I think this is unlikely to be implemented unless someone submits a merge request to do it. Accordingly, I'm going to close this request so that the list of requested features better reflects work in progress or under active consideration. This doesn't mean that the idea is being vetoed, just that there aren't resources to consider implementing it absent volunteer contributions to do so--for which no formal feature request is needed. Thanks for understanding!