mirror of
https://github.com/samoshkin/tmux-config.git
synced 2026-01-04 00:38:01 +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"
|
copy_backend="pbcopy"
|
||||||
elif is_app_installed reattach-to-user-namespace; then
|
elif is_app_installed reattach-to-user-namespace; then
|
||||||
copy_backend="reattach-to-user-namespace pbcopy"
|
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
|
elif [ -n "${DISPLAY-}" ] && is_app_installed xsel; then
|
||||||
copy_backend="xsel -i --clipboard"
|
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
|
fi
|
||||||
|
|
||||||
# if copy backend is resolved, copy and exit
|
# if copy backend is resolved, copy and exit
|
||||||
if [ -n "$copy_backend" ]; then
|
if [ -n "$copy_backend" ]; then
|
||||||
printf "$buf" | "$copy_backend"
|
eval "printf '$buf' | $copy_backend"
|
||||||
exit;
|
exit;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user