From 091622edf759a120c674d8dd8be67e70c3076a97 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Tue, 20 Dec 2016 04:56:11 +0100 Subject: [PATCH] Log planime invocations. --- planime | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/planime b/planime index 0ecb770..20b651e 100755 --- a/planime +++ b/planime @@ -73,6 +73,7 @@ findfile() { origargs=("$0" "$@") cmdline=(mpv -fs) debug= +log=y unset pretend printfile while [ "${1:0:1}" = - ]; do @@ -80,7 +81,7 @@ while [ "${1:0:1}" = - ]; do shift case "$a" in -h) - echo "usage: planime [-fdhtC] [-A PLAYER-ARGS... ;] [-s PAR VAL] [--] [NAME-QUAL] [EP|.] [TYPE-QUAL]" >&2 + echo "usage: planime [-fdhtCL] [-A PLAYER-ARGS... ;] [-s PAR VAL] [--] [NAME-QUAL] [EP|.] [TYPE-QUAL]" >&2 exit 0 ;; -d) @@ -94,6 +95,9 @@ while [ "${1:0:1}" = - ]; do -C) pretend=y ;; + -L) + log= + ;; -A) while :; do if [ $# -lt 1 ]; then @@ -258,6 +262,11 @@ elif [ -n "$printfile" ]; then echo "$file" else if [ "$chwp" = y ]; then (sleep 2; randomwp) & fi + if [ "$log" = y ]; then + if [ -d $HOME/.anime ]; then + echo "$(date) $(basename "$file")" >>$HOME/.anime/plog + fi + fi "${cmdline[@]}" "$file" if [ "$nextep" = y ]; then -- 2.11.0