summaryrefslogtreecommitdiff
path: root/examples/find-lowres
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-02-28 10:25:46 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-02-28 10:25:46 +0100
commit072947e00af9a0ec54220710ff5bbab7cfc04551 (patch)
tree1708fe32df58da8e8ca156239513037b0bbd339b /examples/find-lowres
parent0be6d72c5b9e8c51b89d2a48a4cee37175dfb9af (diff)
add find-lowres example script
Diffstat (limited to 'examples/find-lowres')
-rwxr-xr-xexamples/find-lowres29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/find-lowres b/examples/find-lowres
new file mode 100755
index 0000000..4a7d9a9
--- /dev/null
+++ b/examples/find-lowres
@@ -0,0 +1,29 @@
+#!/usr/bin/env zsh
+# 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 [[ $1 == -* ]]; do
+ case $1 in
+ -r) remove=1 ;;
+ -|--) shift; break ;;
+ esac
+ shift
+done
+
+base=${1-.}
+dimension=${2-1000x800}
+
+if (( remove ))
+then
+ feh --action 'rm %F' -rlV --max-dim ${dimension} ${base}
+else
+ feh -rlV --max-dim ${dimension} ${base}
+fi