use random source when shuffling

This commit is contained in:
Adithya 2023-10-18 22:00:44 +05:30
parent 57eb81f104
commit ee2706b537
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -10,7 +10,7 @@ fi
random_paper() { random_paper() {
if [ -d "$DIR" ] ; then if [ -d "$DIR" ] ; then
find -L "${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1 find -L "${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1 --random-source=/dev/urandom
elif [ -f "$DIR" ] ; then elif [ -f "$DIR" ] ; then
echo "$DIR" echo "$DIR"
fi fi