From 0d05ef1e12314985988e567ac22a179d0f646899 Mon Sep 17 00:00:00 2001 From: msglm Date: Sat, 14 Jan 2023 10:33:04 -0600 Subject: Inital Commit --- .local/bin/playvideo | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 .local/bin/playvideo (limited to '.local/bin/playvideo') diff --git a/.local/bin/playvideo b/.local/bin/playvideo new file mode 100755 index 0000000..8f90a52 --- /dev/null +++ b/.local/bin/playvideo @@ -0,0 +1,26 @@ +#!/bin/sh + +#Description: Shuffles and plays videos from your CONTENTDIR and, upon finishing watching them, removes them. You can pass a number of videos to this program and it'll queue that many videos up for you. + +#Axioms: CONTENTDIR + +#Dependencies: https://packages.debian.org/sid/mpv + + +numofvids=1 +playablevideo="$(find ~/Videos/Content/ -maxdepth 1 -type f | shuf | head -1)" + +if [ $# -eq 0 ] +then + mpv --ontop --geometry=100%:0% --autofit=20%x20% "$playablevideo" + rm "$playablevideo" + exit +fi + +while [ $numofvids -le $1 ] +do + mpv --ontop --geometry=100%:0% --autofit=20%x20% "$playablevideo" + rm "$playablevideo" + playablevideo="$(find ~/Videos/Content/ -maxdepth 1 -type f | shuf | head -1)" + numofvids=$(($numofvids+1)) +done -- cgit v1.2.3