From bbc61d70eace6be4e823ee21e2d6378cf7ba0c8a Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 3 Aug 2024 18:39:17 +0200 Subject: [PATCH] wallpaper: add small shell script to list wallpapers --- wallpapers/list | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 wallpapers/list diff --git a/wallpapers/list b/wallpapers/list new file mode 100755 index 0000000..51ca56a --- /dev/null +++ b/wallpapers/list @@ -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-