diff options
author | horchi <vdr@jwendel.de> | 2017-03-05 16:47:41 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2017-03-05 16:47:41 +0100 |
commit | 22ffee20bbacbc3378e4ba0df5b7f0c3daaeffc0 (patch) | |
tree | de46c945c62d43d1febb027b5bfa075e58c5b69a /scripts/dia.sh | |
download | vdr-plugin-graphtftng-master.tar.gz vdr-plugin-graphtftng-master.tar.bz2 |
Diffstat (limited to 'scripts/dia.sh')
-rwxr-xr-x | scripts/dia.sh | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/scripts/dia.sh b/scripts/dia.sh new file mode 100755 index 0000000..e6e0fe5 --- /dev/null +++ b/scripts/dia.sh @@ -0,0 +1,84 @@ + +INTERVAL=10 +IMAGE_DIR="/ablage/Pictures/" +REPEAD=yes +# MOUNTPOINT=/pub/images/Pictures + +FILE="/tmp/dia.file" +LIST="/tmp/dia.list" + +# --------------------------------------------------- +# stop ?? +# --------------------------------------------------- + +if [ "$1" == "stop" ]; then + svdrpsend.pl plug graphtft VIEW Standard + rm "$LIST" + exit 0 +fi + +# --------------------------------------------------- +# check mount point (if required) +# --------------------------------------------------- + +if [ -n "$MOUNTPOINT" ]; then + check-mount.sh "$MOUNTPOINT" + + if [ "$?" == 1 ]; then + echo mount failed aborting diashow + exit 1 + fi +fi + +# --------------------------------------------------- +# create list +# --------------------------------------------------- + +echo creating image list +find $IMAGE_DIR -name *.jpg -o -name *.JPG > "$LIST" + +# --------------------------------------------------- +# switching mode +# --------------------------------------------------- + +svdrpsend.pl plug graphtft VIEW Dia + +# --------------------------------------------------- +# loop +# --------------------------------------------------- + +echo starting show ... + +while [ -f "$LIST" ]; do + + cat "$LIST" | while read i; do + + # skip thumbnails + + echo $i | grep "/\.pics/" + + if [ "$?" == 1 ]; then + echo $i + echo $i > "$FILE" + svdrpsend.pl PLUG graphtft REFRESH 2>&1 > /dev/null + + sleep $INTERVAL + else + echo skipping $i + fi + + if [ ! -f "$LIST" ]; then + break + fi + + done + + if [ "$REPEAD" != "yes" ]; then + break + fi + +done + +rm -f "$LIST" "$FILE" +exit 0 + |