diff options
| author | yory8 <39745367+yory8@users.noreply.github.com> | 2020-06-20 12:04:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-20 12:04:26 +0200 |
| commit | e3ab03022e6bcf71d2435b9f2a4ab683cd889dbe (patch) | |
| tree | ac47fb3815576acc6439c327a51d7a0cbad66fbd | |
| parent | 1ad19aeb7ee6b6b8446d6262543cd31d9215df4f (diff) | |
| download | vis-e3ab03022e6bcf71d2435b9f2a4ab683cd889dbe.tar.gz vis-e3ab03022e6bcf71d2435b9f2a4ab683cd889dbe.tar.xz | |
Support wayland clipboard (wl-clipboard)
| -rwxr-xr-x | vis-clipboard | 17 |
1 files changed, 17 insertions, 0 deletions
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 } |
