Here's what I have so far
DIR="/home/username/Pictures/Wallpapers"
while [ 1 -eq 1 ]
do
PIC=$(ls $DIR/*.jpg | shuf -n1)
PIC1="file://"$PIC
gsettings set org.gnome.desktop.background picture-uri $PIC1
sleep 30;
done
The script works, but I can't figure out how to expand it to find other file extensions, like png or gif in addition to jpg.
How about using find?
find $DIR -name \*.jpg -o -name \*.png -o -name \*.gif -print
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With