#!/bin/bash # A script to create an automatic HTML slideshow # Possibly to be used for a screen saver # Created by Ben Tasker # Images need to have similar filenames with a unique numeral in them getsettings () { # Get config from user clear echo "All image files should reside in the same directory and should all be named in the same format." echo "" echo "For example they should all be named SSXXXX.jpg where XXXX is a numeral" echo "All files Should contain a unique numeral, which should increase by one between files" echo "" echo "The order of the numbers will determine the order of the slideshow" echo "" echo "The next few questions will determine the filenames to reference, Please do not enter the numerical element of the filename in the prefix or suffix" echo "" echo "Please enter the prefix of the filename (i.e. ss if the filenames follow the convention ssXXXX.jpg)" read PREFIX echo "Please enter the suffix of the image filename (i.e. .jpg using the above example)" read IMAGESUFFIX echo "Please enter the Start Image Number (may not necessarily be 1)" read TITLE echo "Please enter the final Image Number" read ENDTITLE echo "" echo "Ok please now define a title to use for the HTML pages, please avoid special characters" read PAGETITLE clear echo "OK please wait while I generate the pages" # OK we now have the information we need FINALLINK="$PREFIX""$TITLE""$SUFFIX" mainfunction } mainfunction () { # check for the last image if [ "$TITLE" == "$ENDTITLE" ] then # Final Title NEXTFILE=$FINALLINK FILENAME="$PREFIX""$TITLE""$SUFFIX" IMAGENAME="$PREFIX""$TITLE""$IMAGESUFFIX" # Generate the html echo "" > $FILENAME echo "
" >> $FILENAME echo "