With Linux Mint 16 (not sure about other versions) you can use gsettings to both get information about your current wallpaper as well as set it.
The man gsettings is a little thin, but TAB completion will work at most steps in the following commands.
Get info:
gsettings get org.cinnamon.desktop.background picture-uri
gsettings get org.cinnamon.desktop.background picture-opacity
gsettings get org.cinnamon.desktop.background picture-options
To change any option, simply change "get" to "set" and add the new value to the end.
Here is a quick script that will cycle over a known list of wallpapers:
#!/bin/sh
#
# Set the wallpaper from a list
#
# The list, all can be found in $BASE
BASE="file:///home/tigger/.wallpapers/"
LIST="shot1.png another.png just_no_space_in_name.png keep_adding.png"
# The current wallpaper
current=`gsettings get org.cinnamon.desktop.background picture-uri`
opacity=`gsettings get org.cinnamon.desktop.background picture-opacity`
options=`gsettings get org.cinnamon.desktop.background picture-options`
# loop over the list until we find a match
matched=0
new=""
for wp in $LIST
do
if [ $matched -eq 1 ]
then
new="${BASE}${wp}"
break
elif [ "'${BASE}${wp}'" = "${current}" ]
then
matched=1
fi
done
# if "$new" is blank, then we show the first shot
if [ "$new" = "" ]
then
new=${BASE}${LIST%% *}
fi
# set the wallpaper
gsettings set org.cinnamon.desktop.background picture-uri \'${new}\'
gsettings set org.cinnamon.desktop.background picture-opacity ${opacity}
gsettings set org.cinnamon.desktop.background picture-options ${options}