summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-06 15:00:58 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-06 15:00:58 +0200
commitd6a3c1019f833a8236b51244e799b804cc9d90d3 (patch)
tree1ed18c7746aed015299920af19f5c642e3966368
parent09bdbac4c38674b4a104be7d6d213776861ad20a (diff)
made ytclipo wayland sensible
-rwxr-xr-xbin/common/ytclipo8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo
index e97cb94..672633a 100755
--- a/bin/common/ytclipo
+++ b/bin/common/ytclipo
@@ -1,7 +1,13 @@
#!/bin/sh
# argument ($1) -> clipboard -> stdin
-test -z "${inp:=${1:-"$(xclip -sel c -o)"}}" &&
+if [ "$WAYLAND_DISPLAY" ]
+then
+ paste="$(wl-paste)"
+else
+ paste="$(xclip -o -sel c)"
+fi
+test -z "${inp:=${1:-$paste}}" &&
inp="$(cat /dev/stdin)"
# take last link from clipboard