wallpaper: add small shell script to list wallpapers

This commit is contained in:
Vincent Bernat 2024-08-03 18:39:17 +02:00
parent 9d9b95b201
commit bbc61d70ea

10
wallpapers/list Executable file
View file

@ -0,0 +1,10 @@
#!/bin/zsh
find -regextype posix-extended -iregex '.*\.(jpe?g|png|webp)' -print0 \
| xargs -0 identify -format "%[fx:w*h] %[w]x%[h] %i\n" \
| while read pixels resolution name; do
count=$(getfattr --only-values -n user.count $name 2> /dev/null || echo 0)
printf "%s\t%9s\t%5d\t%s\n" $pixels $resolution $count $name
done \
| sort -g -b -k3,3r -k1,1 \
| cut -f2-