added keyb events
[my-code/dfb-photoshow.git] / showdir
diff --git a/showdir b/showdir
index c276687..650e010 100755 (executable)
--- a/showdir
+++ b/showdir
@@ -8,7 +8,7 @@ usage() {
  echo
 }
 
-if [ "$#" <= "2" ]; then
+if [ -z "$1" -o ! -d "$2" ]; then
        usage
        exit 0
 fi
@@ -18,9 +18,11 @@ dir="$2"
 files="`find $dir -name '*.jpg'`
 `find $dir -name '*.JPG'`
 `find $dir -name '*.jpe'`
-`find $dir -name '*.IPE'`"
+`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