Support for wayland clipboard

This commit is contained in:
2026-01-26 13:30:20 +01:00
parent 397704f046
commit d26e2dbce6

15
init.el
View File

@@ -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."