File: find-lowres

package info (click to toggle)
feh 3.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 3,492 kB
  • sloc: ansic: 13,506; perl: 1,011; makefile: 208; sh: 29
file content (32 lines) | stat: -rwxr-xr-x 625 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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