I have an alternative script for anyone interested. Adapted from the script I used to use with gnome, with help from the script's original author mhgsys.
Code:
#!/bin/bash
until [ 1 -eq 2 ]; do
# Script to randomly set Background from files in a directory
# Directory Containing Pictures
DIR="/home/tv/Public/Wallpaper"
# Command to Select a random jpg file from directory
# Delete the *.jpg to select any file but it may return a folder
PIC=$(ls $DIR/*.jpg | shuf -n1)
# Command to set Background Image
pcmanfm --set-wallpaper=$PIC
sleep 30s
done
Bookmarks