From d268275ace90e9796d7267b81da73517e36de3b9 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Tue, 14 May 2024 23:56:56 +0530 Subject: [PATCH] always pick an image from the first 120 --- packages/scripts/wallhaven.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/scripts/wallhaven.sh b/packages/scripts/wallhaven.sh index 7f7edf8..ac59683 100755 --- a/packages/scripts/wallhaven.sh +++ b/packages/scripts/wallhaven.sh @@ -75,6 +75,9 @@ if [ "${NO_OF_IMAGES}" -eq 0 ]; then echo "No wallpapers available for current configuration" >&2 exit 1 fi +if [ "${NO_OF_IMAGES}" -gt 120 ]; then + NO_OF_IMAGES=120 +fi RANDOM_ITEM="$(shuf -i 0-$((NO_OF_IMAGES-1)) -n 1 --random-source=/dev/urandom)" ITEM_PAGE=$((RANDOM_ITEM/24)) ITEM_NUMBER=$((RANDOM_ITEM%24))