Created
July 3, 2016 16:51
-
-
Save macgyver/46fa1515fc78a3f1eb4526a752723981 to your computer and use it in GitHub Desktop.
List all images large enough for use as a wallpaper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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