From 5bc947db3d41ab59f544c9ec1de213da24795a42 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 27 Nov 2023 11:32:03 +0100 Subject: [PATCH] Scripts: Play video from clipboard --- .local/bin/play | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.local/bin/play b/.local/bin/play index 321cde5..ae9f7c6 100755 --- a/.local/bin/play +++ b/.local/bin/play @@ -1,6 +1,6 @@ #!/bin/sh -# Depends: GNU getopt, mpv, socat, streamlink +# Depends: GNU getopt, mpv, socat, streamlink, xclip SOCK="/tmp/umpv-fifo" @@ -256,7 +256,11 @@ elif [ $shuffleOption -eq 1 ]; then elif [ $queueOption -eq 1 ]; then queue "$*" else - for url in "$@"; do - play "$url" - done + if [ "$*" = "" ]; then + play "$(xclip -o)" + else + for url in "$@"; do + play "$url" + done + fi fi