Created
December 23, 2021 11:13
-
-
Save juliavdkris/a2deabd1ba72a0f633bf7eaed5316280 to your computer and use it in GitHub Desktop.
Filter wallpapers by resolution
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
| #!/bin/bash | |
| MIN_WIDTH=2560 | |
| MIN_HEIGHT=1440 | |
| mkdir {lowres,highres} | |
| identify -format "%f, %w, %h\n" *.{png,jpg,jpeg,jfif,webp} 2>/dev/null | | |
| awk -F ',' "\$2 >= $MIN_WIDTH && \$3 >= $MIN_HEIGHT {print \$1}" | | |
| xargs -I % echo "echo '%' && mv '%' highres/" | sh | |
| echo '### Moving the rest to ./lowres/ ###' | |
| mv *.{png,jpg,jpeg,jfif,webp} lowres/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment