mirror of
https://github.com/samoshkin/tmux-config.git
synced 2026-01-03 08:18:02 +00:00
Copy into primary and clipboard buffers on Linux using xclip
This commit is contained in:
@@ -15,15 +15,15 @@ if is_app_installed pbcopy; then
|
||||
copy_backend="pbcopy"
|
||||
elif is_app_installed reattach-to-user-namespace; then
|
||||
copy_backend="reattach-to-user-namespace pbcopy"
|
||||
elif [ -n "${DISPLAY-}" ] && is_app_installed xclip; then
|
||||
copy_backend="xclip -selection clipboard -i"
|
||||
elif [ -n "${DISPLAY-}" ] && is_app_installed xsel; then
|
||||
copy_backend="xsel -i --clipboard"
|
||||
elif [ -n "${DISPLAY-}" ] && is_app_installed xclip; then
|
||||
copy_backend="xclip -i -f -selection primary | xclip -i -selection clipboard"
|
||||
fi
|
||||
|
||||
# if copy backend is resolved, copy and exit
|
||||
if [ -n "$copy_backend" ]; then
|
||||
printf "$buf" | "$copy_backend"
|
||||
eval "printf '$buf' | $copy_backend"
|
||||
exit;
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user