From e04eb710bbd01c0f6f486c037815687081c21d4b Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 12 Dec 2023 00:12:10 +0100 Subject: added ytlink --- bin/common/ytclipo | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'bin/common/ytclipo') diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 959ee21..1a82df2 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -1,23 +1,6 @@ #!/bin/sh -# argument ($1) -> clipboard -> stdin -if [ "$WAYLAND_DISPLAY" ] -then paste() { wl-paste; } -elif [ "$TERMUX_VERSION" ] -then paste() { termux-clipboard-get; } -else paste() { xclip -o -sel c; } -fi - -inp="$1" -[ "${inp:=$(paste)}" ] || inp="$(cat /dev/stdin)" - -# remove util scheme -inp="${inp#*//}" -# convert to youtube.com/path url -# works for: -# - 'youtu.be/watch?v=xxxxxx' -# - 'https://piped.video/watch?v=xxxxx' -inp="https://youtube.com/${inp#*/}" +inp="$(ytlink)" >&2 printf "inp: %s\n" "$inp" notify-send "ytclipo" "downloading $inp" || : -- cgit v1.2.3