From 4c1e5aa8ce7aa5d2e4a209385d25be521f32649b Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Sun, 7 Jan 2024 21:00:27 +0900 Subject: [PATCH] Add pgtk --- .emacs.d/init.d/arch/gnu/linux/init.el | 35 +++++++++++++------------- .zsh/.zshrc.mine | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.emacs.d/init.d/arch/gnu/linux/init.el b/.emacs.d/init.d/arch/gnu/linux/init.el index f337738..e1a89f3 100644 --- a/.emacs.d/init.d/arch/gnu/linux/init.el +++ b/.emacs.d/init.d/arch/gnu/linux/init.el @@ -3,23 +3,24 @@ (if (display-graphic-p) (progn (set-face-attribute 'default nil :family "UDEV Gothic JPDOC" :height 120) - (when (executable-find "wl-copy") - ;; https://www.emacswiki.org/emacs/CopyAndPaste#h5o-4 - ;; 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)) - (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)))) + (when (equal window-system 'pgtk) + (when (executable-find "wl-copy") + ;; https://www.emacswiki.org/emacs/CopyAndPaste#h5o-4 + ;; 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)) + (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))))) ;; (setq initial-frame-alist ;; (append (list ;; '(height . 32) diff --git a/.zsh/.zshrc.mine b/.zsh/.zshrc.mine index 3df7c7a..d08967c 100644 --- a/.zsh/.zshrc.mine +++ b/.zsh/.zshrc.mine @@ -49,7 +49,7 @@ export WEBKIT_FORCE_SANDBOX=0 # then # sudo ln -s /mnt/wslg/.X11-unix /tmp/.X11-unix # fi -if which xrdb > /dev/null; then xrdb -merge ~/.Xresources; fi +# if which xrdb > /dev/null; then xrdb -merge ~/.Xresources; fi if [ -z "$WAYLAND_DISPLAY" ] then if which setxkbmap > /dev/null; then setxkbmap -layout us; fi