Dion Moult Seriously who ever reads this description.

Tech Tip #9: use Klipper to automatically post to a Pastebin.

I haven’t done a tech tip in a while, but here’s a nice, simple one which I am finding very useful.

Pastebins are a really useful way to share snippets of text. However it’s sometimes a bit cumbersome to have to open a browser window, type in the URL, paste it in, click submit, then copy the URL to share with your friend. That’s why things like wgetpaste exist – small command-line utilities to automate this process and return the URL. wgetpaste isn’t the only one, of course, but they’re all rather similar.

Klipper is KDE’s Clipboard manager – whenever you copy something, via right click -> copy or ctrl-c, it gets added to your clipboard. Klipper allows you to navigate through it – so that you can paste something you copied a while back, or set up custom things to paste, or even – which is what I’ll talk about today – set it to automatically perform an action on the paste. The most common use is to automatically open a link in a browser if you copy a link from somewhere.

What we’ll tackle is to get Klipper to autopaste our clipboard item into a pastebin, and return the URL to us. So just set it up as shown below:

And you’re done! Copy something, press ctrl-alt-r to invoke the actions menu, click “Pastebin”, and now the URL of the pasted item will be in your clipboard for you to ctrl-v to your friend. Neat, eh?


7 Comments

gcala says: (27 November 2011)

Did you try Pastebin plasmoid? Not only you can drop text or images on it, but context menu has “Paste” function, that works like you describe, no need of wgetpaste. Try it.

Bye

Aaron Seigo says: (27 November 2011)

the share plasmoid is often very convenient for this as well. it also supports images and drag and drop.the resulting url appears in a notification and is copied to the clipboard. ot does this using the share dataengine so it is easy to reuse this functionality in other places as well.

Dion Moult says: (27 November 2011)

Thanks for the tips! I have used the pastebin plasmoids before but very often I work outside a plasma-desktop environment and for that, klipper is more handy.

fan says: (28 November 2011)

Thanks a lot for your tip. I use pastebin just few times and for this reason to have on my desktop the share plasmoid is only a waste of space. I prefer your solution.

Dion Moult says: (28 November 2011)

That’s very true, fan. Lack of space is another reason I might be inclined to call the pastebin widget a duplicated feature.

Robert says: (29 November 2011)

Exactly this topic was at least one time already on the planet.

So just for completeness: http://salout.github.com/blog/2010/03/03/awesome_klipper_workflow.html

Dion Moult says: (29 November 2011)

Ah, Robert, thanks for that – I don’t think I was on the planet early 2010.

Leave a Comment