I wanted to sort my wallpaper collection by resolution. Maybe it will be useful to someone.
picseg.sh:
Code: Select all
#!/bin/sh
for pic in "$@"
do
ret=($(imginfo -f "$pic"))
res=${ret[2]}x${ret[3]}
if [[ ! -d "$res" ]]
then
mkdir "$res"
fi
if [[ ! -f "$res/$pic" ]]
then
mv "$pic" "$res"
fi
done
usage:
Code: Select all
picseg.sh *.jpg