Skip to content

Instantly share code, notes, and snippets.

@juliavdkris
Created December 23, 2021 11:13
Show Gist options
  • Select an option

  • Save juliavdkris/a2deabd1ba72a0f633bf7eaed5316280 to your computer and use it in GitHub Desktop.

Select an option

Save juliavdkris/a2deabd1ba72a0f633bf7eaed5316280 to your computer and use it in GitHub Desktop.
Filter wallpapers by resolution
#!/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