return 1
}
+origargs=("$0" "$@")
cmdline=(mplayer -fs)
while [ "${1:0:1}" = - ]; do
exit 1
fi
fi
-file="$(findfile "$base - " "$ep" "$qual")"
+if [ -z "$file" ]; then
+ file="$(findfile "$base - " "$ep" "$qual")"
+fi
if [ -z "$file" -o ! -r "$file" ]; then
echo "planime: no matching file found" >&2
unset delay
if [ -r "$ifile" ]; then
- delay="`sed -n 's/delay *: *\([^ ]*\)$/\1/p' <"$ifile"`"
+ delay="$(sed -n 's/delay *: *\([^ ]*\)$/\1/p' <"$ifile")"
cmdline=("${cmdline[@]}" -delay "$delay")
else
cmdline=("${cmdline[@]}" "${defopts[@]}")
if [ "$chwp" = y ]; then (sleep 2; randomwp) & fi
"${cmdline[@]}" "$file"
+
+if [ "$nextep" = y ]; then
+ echo "0. Save and continue (or Space)"
+ echo "1. Continue without saving"
+ echo "2. Save and exit (or Enter)"
+ echo "3. Exit without saving (or any key)"
+ IFS= read -sn1 c
+ save=n
+ cont=n
+ case "$c" in
+ 0|" ")
+ save=y
+ cont=y
+ ;;
+ 1)
+ cont=y
+ ;;
+ 2|"")
+ save=y
+ ;;
+ esac
+ if [ "$save" = y ]; then
+ let ep++
+ echo "$ep" >nextep
+ fi
+ if [ "$cont" = y ]; then
+ exec "${origargs[@]}"
+ else
+ echo "nextep is $ep"
+ fi
+fi