summaryrefslogtreecommitdiff
path: root/examples/find-lowres
diff options
context:
space:
mode:
Diffstat (limited to 'examples/find-lowres')
-rwxr-xr-xexamples/find-lowres32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/find-lowres b/examples/find-lowres
new file mode 100755
index 0000000..ac77e7b
--- /dev/null
+++ b/examples/find-lowres
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Recursively find images below a certain resolution
+#
+# Usage: find-lowres [-r] [directory [dimension]]
+#
+# directory defaults to . (the current working directory),
+# dimension defaults to 1000x800 pixels
+#
+# With -r: removes images instead of just listing them. Use at your own risk.
+
+remove=0
+
+while true
+do
+ case $1 in
+ -r) remove=1 ;;
+ -*) echo "option \"$1\" ignored" ;;
+ -|--) shift; break ;;
+ *) break ;;
+ esac
+ shift
+done
+
+dir=${1:-.}
+dimension=${2:-1000x800}
+
+if [ "$remove" = "1" ]
+then
+ feh --action 'rm %F' -rlV --max-dim "${dimension}" "${dir}"
+else
+ feh -rlV --max-dim "${dimension}" "${dir}"
+fi