From 6ef2e516ef26986e0b9a33fc1baac4d623262abf Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 22 May 2023 21:20:13 -0400 Subject: [PATCH] add sort-wallpapers script --- scripts/sort-wallpapers | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 scripts/sort-wallpapers diff --git a/scripts/sort-wallpapers b/scripts/sort-wallpapers new file mode 100755 index 0000000..21ddc8c --- /dev/null +++ b/scripts/sort-wallpapers @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# WALLPAPER_DIR=${HOME}/Drives/Stuff/Pictures/Waifus +WALLPAPER_DIR=${HOME}/Pictures/Screenshots + +readarray -td '' wallpapers < <( + fd -ap -e jpg -e jpeg -e png -e webp \ + --max-depth 2 \ + --print0 \ + --base-directory "$WALLPAPER_DIR" +) + +# open all images in imv +imv "${wallpapers[@]}" & +pid=$! + +sleep 1 + +for img in "${wallpapers[@]}"; do + + echo "$img" + sleep ".2" + + imv-msg "$pid" next +done + +imv-msg "$pid" close all