Fork me on GitHub
#announcements
<
2018-09-08
>
uwo16:09:24

Just a simple idea of slurping and spitting to paste buffer that I’ve gotten a lot of use out of on osx. Easily adaptable to a linux cli tool. https://gist.github.com/uwo/23b7a81fd97818368400bb7c02086562

👍 12
val_waeselynck17:09:36

Worth noting that it won't work for remote REPLs though!

uwo17:09:42

indeed! only a local dev convenience.

peterwestmacott13:09:33

I think you can do this in a platform independent way with Java interop using eg:

(defn ->clipboard [text]
  (let [ss (StringSelection. text)]
    (-> (Toolkit/getDefaultToolkit) .getSystemClipboard (.setContents ss ss))))

uwo13:09:09

I had used that, but preferred to not spin up the java task. Pollutes my alt-tabbing 😄

flowthing11:09:32

I haven't used that, but wouldn't setting the java.awt.headless system property to true avoid the Alt+Tab pollution?

peterwestmacott13:09:51

if you set it to headless you can’t use the clipboard: HeadlessException sun.awt.HeadlessToolkit.getSystemClipboard (HeadlessToolkit.java:309)