From e388290c672510abe5279e156c53c00f9992d9e3 Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 12 Nov 2025 15:09:03 +0300 Subject: [PATCH] fix clipboard --- home/user/.config/sway/autostart.conf | 4 +++- home/user/.config/tmux/mappings.conf | 8 ++++---- home/user/.config/zsh/aliases | 4 ++-- home/user/.config/zsh/mappings | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/home/user/.config/sway/autostart.conf b/home/user/.config/sway/autostart.conf index db38f73..d41fef5 100644 --- a/home/user/.config/sway/autostart.conf +++ b/home/user/.config/sway/autostart.conf @@ -4,7 +4,9 @@ exec swayidle -w \ timeout 1800 'swaylock -f' \ timeout 1805 'swaymsg "output * power off"' \ - resume 'swaymsg "output * power on"' + resume 'swaymsg "output * power on"' \ + before-sleep 'swaylock -f' + # Notifications #systemctl --user enable --now dbus.service diff --git a/home/user/.config/tmux/mappings.conf b/home/user/.config/tmux/mappings.conf index a7ea030..4d6dc81 100644 --- a/home/user/.config/tmux/mappings.conf +++ b/home/user/.config/tmux/mappings.conf @@ -183,14 +183,14 @@ bind C-p choose-buffer bind -T copy-mode-vi C-v send-keys -X rectangle-toggle -bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard" +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy" bind -T copy-mode-vi Y send-keys -X copy-selection-and-cancel bind MouseDrag1Pane copy-mode -bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard" +bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "wl-copy" -bind -r p run-shell "xclip -selection clipboard -o | tmux load-buffer -; tmux paste-buffer -p" -bind -r з run-shell "xclip -selection clipboard -o | tmux load-buffer -; tmux paste-buffer -p" +bind -r p run-shell "wl-paste | tmux load-buffer -; tmux paste-buffer -p" +bind -r з run-shell "wl-paste | tmux load-buffer -; tmux paste-buffer -p" bind -r P paste-buffer -p diff --git a/home/user/.config/zsh/aliases b/home/user/.config/zsh/aliases index 48a3650..82ee774 100644 --- a/home/user/.config/zsh/aliases +++ b/home/user/.config/zsh/aliases @@ -131,8 +131,8 @@ alias pastewww='paste.thek4n.ru' # clipboard if [[ "${OSTYPE}" == "linux-gnu"* ]]; then if [ -n "${DISPLAY}" ]; then - alias _copy='sed -z "$ s/\n$//" | xclip -selection clipboard -i' - alias pasta='xclip -selection clipboard -o' + alias _copy='sed -z "$ s/\n$//" | wl-copy' + alias pasta='wl-paste' else alias _copy='read -rd "EOF" TTYCLIPBOARD' alias pasta='echo "$TTYCLIPBOARD"' diff --git a/home/user/.config/zsh/mappings b/home/user/.config/zsh/mappings index 20f4cea..127dea1 100644 --- a/home/user/.config/zsh/mappings +++ b/home/user/.config/zsh/mappings @@ -11,7 +11,7 @@ bindkey -M visual 'a' vi-add-next # Yank to the system clipboard function vi-yank-xclip { zle vi-yank - echo -n "$CUTBUFFER" | copy # alias 'copy' from earlier loaded file + echo -n "$CUTBUFFER" | wl-copy # alias 'copy' from earlier loaded file } zle -N vi-yank-xclip