Skip to content

Commit

Permalink
configs: handle wayland clipboard with copyq
Browse files Browse the repository at this point in the history
  • Loading branch information
gudzpoz committed Jul 19, 2024
1 parent cae3fa8 commit 62ae24d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions configs/.spacemacs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ This function should only modify configuration layer settings."
(shell :variables
shell-default-shell 'eshell
shell-default-term-shell "/bin/zsh"
shell-default-height 30
shell-default-position 'bottom)
shell-default-position 'full
shell-protect-eshell-prompt nil)
spacemacs-visual
spacemacs-editing-visual
sql
Expand Down Expand Up @@ -930,7 +930,15 @@ See also `org-save-all-org-buffers'"

;; No mouse in console, so as to enable using mouse to select-&-copy things.
(xterm-mouse-mode -1)

(xclip-mode 1)
(setq wayland-detected nil)
(add-to-list 'after-make-frame-functions
(lambda (_frame)
(when (and (getenv "WAYLAND_DISPLAY") (not wayland-detected))
(setq wayland-detected t)
(setq xclip-method 'wl-copy)
(setq xclip-program "wl-copy"))))

;; Replace Ctrl+S with helm-swoop
(global-set-key (kbd "C-s") 'helm-swoop)
Expand Down Expand Up @@ -1363,6 +1371,7 @@ See also `org-save-all-org-buffers'"
(new-entries (butlast copyq-entries (- (length copyq-entries) (or new-entry-index (length copyq-entries))))))
(setq kill-ring (append new-entries kill-ring))))
(add-function :after after-focus-change-function #'copyq--sync-clipboard-with-kill-ring)
(setq interprogram-paste-function (lambda () (copyq--sync-clipboard-with-kill-ring 1) nil))

;; Global visual line mode
(global-visual-line-mode 1)
Expand Down

0 comments on commit 62ae24d

Please sign in to comment.