From ccbfdf2091356e001b384d8e03ad863dc989bbf1 Mon Sep 17 00:00:00 2001 From: sarumont Date: Mon, 8 Aug 2022 14:08:36 -0600 Subject: [PATCH] added support for wl-clipboard, closes #589, closes #606 see https://github.com/bugaevc/wl-clipboard --- .tmux.conf | 3 +++ .tmux.conf.local | 2 +- README.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index b71bbae..b8c30c9 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -150,6 +150,8 @@ run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' # copy to X11 clipboard if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"' if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"' +# copy to Wayland clipboard +if -b 'command -v wl-copy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | wl-copy"' # copy to macOS clipboard if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | pbcopy"' if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"' @@ -814,6 +816,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false} # command -v xsel > /dev/null 2>&1 && command='xsel -i -b' # ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > \/dev\/null 2>\&1' +# command -v wl-copy > /dev/null 2>&1 && command='wl-copy' # command -v pbcopy > /dev/null 2>&1 && command='pbcopy' # command -v reattach-to-user-namespace > /dev/null 2>&1 && command='reattach-to-user-namespace pbcopy' # command -v clip.exe > /dev/null 2>&1 && command='clip\.exe' diff --git a/.tmux.conf.local b/.tmux.conf.local index 4bc6c83..7fc8a09 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -329,7 +329,7 @@ tmux_conf_theme_clock_style="24" # - false (default) # - disabled # on macOS, this requires installing reattach-to-user-namespace, see README.md -# on Linux, this requires xsel or xclip +# on Linux, this requires xsel, xclip or wl-copy tmux_conf_copy_to_os_clipboard=false diff --git a/README.md b/README.md index 84263e5..dd79dec 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Features - configurable new windows and panes behavior (optionally retain current path) - SSH/Mosh aware split pane (reconnects to remote server) - copy to OS clipboard (needs [`reattach-to-user-namespace`][reattach-to-user-namespace] - on macOS, `xsel` or `xclip` on Linux) + on macOS, `xsel`, `xclip`, or `wl-copy` on Linux) - support for 4-digit hexadecimal Unicode characters - [Facebook PathPicker][] integration if available - [Urlview][] integration if available