summaryrefslogtreecommitdiffstats
path: root/.local/bin/playvideo
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/playvideo')
-rwxr-xr-x.local/bin/playvideo26
1 files changed, 26 insertions, 0 deletions
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