From e3ab03022e6bcf71d2435b9f2a4ab683cd889dbe Mon Sep 17 00:00:00 2001 From: yory8 <39745367+yory8@users.noreply.github.com> Date: Sat, 20 Jun 2020 12:04:26 +0200 Subject: Support wayland clipboard (wl-clipboard) --- vis-clipboard | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'vis-clipboard') diff --git a/vis-clipboard b/vis-clipboard index 0ceed70..098fa8c 100755 --- a/vis-clipboard +++ b/vis-clipboard @@ -12,6 +12,15 @@ vc_usage() { } vc_determine_command() { + if [ -n "$WAYLAND_DISPLAY" ]; then + for c in wl-copy wl-paste; do + if type "$c" >/dev/null 2>&1; then + echo "wlclipboard" + return 0 + fi + done + fi + if [ -n "$DISPLAY" ]; then for c in xclip xsel; do if type "$c" >/dev/null 2>&1; then @@ -66,6 +75,14 @@ vc_paste() { exit $? } +vc_wlclipboard_copy() { + wl-copy -t TEXT +} + +vc_wlclipboard_paste() { + wl-paste -t text +} + vc_xsel_copy() { xsel -bi } -- cgit v1.2.3