#!/bin/sh
# Wallpapers location
wploc='/home/greg/images/wallpapers/'
cd $wploc
FILENAMES=( `find $wploc -maxdepth 1 -iname '*.jpg'|tr '\n' ' '` )
# Count wallpapers
N=${#FILENAMES[@]}-1
# Pick a random wallpaper number
NUM=$(($RANDOM % $N + 1));
# Set wallpaper
# echo "$wploc$BGNAME"
gconftool-2 -t str --set /desktop/gnome/background/picture_filename "${FILENAMES[$NUM]}"
# Set tiling parameters
gconftool-2 -t str --set /desktop/gnome/background/picture_options "stretched"
#Possible values are "none", "wallpaper" (eg tiled), "centered", "scaled", "stretched"
This is based on someone else's script on the Ubuntu forums that really doesn't work worth a $!*&.