diff --git a/.config/doom/config.el b/.config/doom/config.el index 6dc2e81..2bf38b3 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -25,3 +25,19 @@ (load! "penguin/serial-terminator.el") (setq x-super-keysym 'meta) +;; credit: yorickvP on Github +(setq wl-copy-process nil) +(defun wl-copy (text) + (setq wl-copy-process (make-process :name "wl-copy" + :buffer nil + :command '("wl-copy" "-f" "-n") + :connection-type 'pipe + :noquery t)) + (process-send-string wl-copy-process text) + (process-send-eof wl-copy-process)) +(defun wl-paste () + (if (and wl-copy-process (process-live-p wl-copy-process)) + nil ; should return nil if we're the current paste owner + (shell-command-to-string "wl-paste -n | tr -d \r"))) +(setq interprogram-cut-function 'wl-copy) +(setq interprogram-paste-function 'wl-paste)