Fork me on GitHub

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.

👍 12

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


indeed! only a local dev convenience.

Rachel Westmacott13: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))))


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


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

Rachel Westmacott13:09:51

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