support copying link to clipboard

Bug #1294893 reported by kernc_
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pastebinit
Triaged
Wishlist
Unassigned

Bug Description

I'd have pastebinit support a command-line switch that made the returned paste-link copied to users clipboard.

That could be easily achieved:
* a new -c command line switch,
* check if xclip or xsel exist (http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/377028#377028),
* if either does: do a final subprocess.Popen('echo ' + paste_link + '| xclip -selection clipboard') or subprocess.Popen('echo ' + paste_link + '| xsel --input --clipboard'), as appropriate
  (would have to split those strings into tokens though, or use Popen(..., shell=True) )

trivial and good enough! :)

am happy to provide a patch.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Having this as an optional function would be fine I think.

Changed in pastebinit:
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.