always pick an image from the first 120

This commit is contained in:
Adithya 2024-05-14 23:56:56 +05:30
parent 478ac040df
commit d268275ace
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C

View file

@ -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))