Skip to content

Instantly share code, notes, and snippets.

@macgyver
Created July 3, 2016 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macgyver/46fa1515fc78a3f1eb4526a752723981 to your computer and use it in GitHub Desktop.
Save macgyver/46fa1515fc78a3f1eb4526a752723981 to your computer and use it in GitHub Desktop.
List all images large enough for use as a wallpaper
# first replace spaces in file names with underscores
find ~/Pictures/ -depth -name '* *' \
| while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done
# then use graphicsmagick to print filenames of appropriate dimensions
gm identify -format "%w %h %f\n" ~/Pictures/*.jpg | awk '{if ($1 > 1024 && $2 > 768) print $3}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment