diff --git a/init.el b/init.el index 3d24c3f..b721689 100644 --- a/init.el +++ b/init.el @@ -84,6 +84,21 @@ (setq auto-save-default nil) (setq create-lockfiles nil) +(when (getenv "WAYLAND_DISPLAY") + ;; Without this, copy and pasting from other wayland apps into + ;; emacs-pgtk doesn't work. + ;; https://www.emacswiki.org/emacs/CopyAndPaste#h5o-4 + (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)) + (setq interprogram-cut-function 'wl-copy)) + ;; Dired settings (defun embark-open-externally (file) "Open FILE externally using the default application of the system."