diff --git a/hosts/pinwheel/modules/emacs/config.org b/hosts/pinwheel/modules/emacs/config.org index 1eb76ca..7bed5ed 100644 --- a/hosts/pinwheel/modules/emacs/config.org +++ b/hosts/pinwheel/modules/emacs/config.org @@ -83,24 +83,22 @@ ** Use wl-clipboard for interprocess copy/paste #+BEGIN_SRC emacs-lisp (setq wl-copy-process nil) + (when (string-prefix-p "wayland" (getenv "WAYLAND_DISPLAY")) + (defun wl-copy (text) + (setq wl-copy-process (make-process :name "wl-copy" + :buffer nil + :command '("wl-copy" "-f" "-n") + :connection-type 'pipe)) + (process-send-string wl-copy-process text) + (process-send-eof wl-copy-process)) - (defun wl-copy (text) - (setq wl-copy-process (make-process :name "wl-copy" - :buffer nil - :command '("wl-copy" "-f" "-n") - :connection-type 'pipe)) - (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"))) - (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"))) - - (when (display-graphic-p) (setq interprogram-cut-function 'wl-copy) - (setq interprogram-paste-function 'wl-paste) - ) + (setq interprogram-paste-function 'wl-paste)) #+END_SRC ** Don't create backup files, don't create #autosave# files #+BEGIN_SRC emacs-lisp