dotfiles/termscripts/play-videos-from-file.sh
2019-12-04 13:15:35 +01:00

21 lines
369 B
Bash

#!/usr/bin/env sh
[ -z "$1" -o ! -f "$1" ] && exit 1
length="$(wc -l "$1" | awk '{print $1}')"
current_video=0
while [ $length -ne $current_video ]
do
current_video="$(( $current_video + 1 ))"
video="$(sed "$current_video q;d" "$1")"
mpv "$video"
length="$(wc -l "$1")"
if [ "$length" -eq "$current_video" ]; then
sleep 5m
fi
done