added keyb events
[my-code/dfb-photoshow.git] / showdir
diff --git a/showdir b/showdir
index 2e7d71b..650e010 100755 (executable)
--- a/showdir
+++ b/showdir
@@ -8,18 +8,21 @@ usage() {
  echo
 }
 
-if [ "$#" <= "2" ]; then
+if [ -z "$1" -o ! -d "$2" ]; then
        usage
        exit 0
 fi
 
 dir="$2"
 
-files=`find $dir -name '*.jpg'`
-files="$files
-`find $dir -name '*.JPG'`"
+files="`find $dir -name '*.jpg'`
+`find $dir -name '*.JPG'`
+`find $dir -name '*.jpe'`
+`find $dir -name '*.JPE'`
+`find $dir -name '*.png'`
+`find $dir -name '*.PNG'`"
 
-./dfb-photoshow $1 $files
+[ ! -z "`echo $files | sed 's/\ //g'`" ] && ./dfb-photoshow $1 $files
 
 echo
 echo done