diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/photoalbum.default.conf | 2 | ||||
| -rwxr-xr-x | src/photoalbum.sh | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/photoalbum.default.conf b/src/photoalbum.default.conf index 51cf886..51b2118 100644 --- a/src/photoalbum.default.conf +++ b/src/photoalbum.default.conf @@ -7,6 +7,8 @@ THUMBHEIGHT=300 HEIGHT=1200 # Max previews per page. MAXPREVIEWS=40 +# Randomly shuffle all previews. +# SHUFFLE=yes # Diverse directories, need to be full paths, not relative! INCOMING_DIR=$(pwd)/incoming diff --git a/src/photoalbum.sh b/src/photoalbum.sh index 31c96fb..0f4e0f6 100755 --- a/src/photoalbum.sh +++ b/src/photoalbum.sh @@ -89,6 +89,14 @@ animate-zoom END } +maybe_shuffle () { + if [ "$SHUFFLE" = yes ]; then + sort -R + else + sort + fi +} + albumhtml () { declare photos_dir="$1" ; shift declare html_dir="$1" ; shift @@ -98,7 +106,6 @@ albumhtml () { declare -i num=1 declare -i i=0 - declare name="page-$num" # Random background image for preview page. @@ -106,7 +113,7 @@ albumhtml () { export show_header_bar='yes' template 'header' "$name.html" - cd "$DIST_DIR/$photos_dir" && find ./ -type f | sort | sed 's;^\./;;' | + cd "$DIST_DIR/$photos_dir" && find ./ -type f | maybe_shuffle | sed 's;^\./;;' | while read -r photo; do let i++ |
