aboutsummaryrefslogtreecommitdiff
path: root/vis-clipboard
diff options
context:
space:
mode:
authoryory8 <39745367+yory8@users.noreply.github.com>2020-06-20 12:04:26 +0200
committerGitHub <noreply@github.com>2020-06-20 12:04:26 +0200
commite3ab03022e6bcf71d2435b9f2a4ab683cd889dbe (patch)
treeac47fb3815576acc6439c327a51d7a0cbad66fbd /vis-clipboard
parent1ad19aeb7ee6b6b8446d6262543cd31d9215df4f (diff)
downloadvis-e3ab03022e6bcf71d2435b9f2a4ab683cd889dbe.tar.gz
vis-e3ab03022e6bcf71d2435b9f2a4ab683cd889dbe.tar.xz
Support wayland clipboard (wl-clipboard)
Diffstat (limited to 'vis-clipboard')
-rwxr-xr-xvis-clipboard17
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
}