From d6a3c1019f833a8236b51244e799b804cc9d90d3 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 6 Apr 2023 15:00:58 +0200 Subject: made ytclipo wayland sensible --- bin/common/ytclipo | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3