X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=planime;h=32d79058f9e08940df2f51767c06006310163b8a;hb=251d97caa7aeb7e855efa183798c65163506b1f0;hp=41332ae3c369b71a37dae46b3c6a033ee27bf81f;hpb=4c7a7e7043150ed7b1d49ceba84f9d67785d4185;p=utils.git diff --git a/planime b/planime index 41332ae..32d7905 100755 --- a/planime +++ b/planime @@ -34,6 +34,7 @@ findfile() { return 1 } +origargs=("$0" "$@") cmdline=(mplayer -fs) while [ "${1:0:1}" = - ]; do @@ -124,7 +125,7 @@ fi 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[@]}") @@ -134,3 +135,31 @@ if [ "`hostname`" = pc6 ]; then chwp=y; fi if [ "$chwp" = y ]; then (sleep 2; randomwp) & fi "${cmdline[@]}" "$file" + +if [ "$nextep" = y ]; then + echo "0. Save and continue" + echo "1. Continue without saving" + echo "2. Save and exit" + echo "3. Exit without saving" + IFS= read -sn1 c + save=n + cont=n + case "$c" in + 0|" ") + save=y + cont=y + ;; + 1) + cont=y + ;; + 2|$'\e') + save=y + ;; + esac + if [ "$save" = y ]; then + echo "$(($ep + 1))" >nextep + fi + if [ "$cont" = y ]; then + exec "${origargs[@]}" + fi +fi