Created
June 16, 2020 20:06
-
-
Save ddn/f5dbd9304d0a0162430e7c0e3eb35ee1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# get rid of the cursor so we don't see it when videos are running | |
# set here the path to the directory containing your videos | |
VIDEOPATH="/media/usb/" | |
# you can normally leave this alone | |
SERVICE="omxplayer" | |
# now for our infinite loop! | |
while true; do | |
if ps ax | grep -v grep | grep $SERVICE > /dev/null | |
then | |
sleep 1; | |
else | |
#for entry in $VIDEOPATH/* | |
IFS='' | |
find $VIDEOPATH -maxdepth 1 -iname '*' -type f -not -path '*/\.*'| shuf | while read entry | |
do | |
# clear | |
echo -n $entry | xargs -0 omxplayer -r --no-osd --aspect-mode fill > /dev/null 2>&1 | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment