Walk a tree looking for jpg files and pick one at random. Use that file as the wallpaper for the desktop. My picture files are in many sub dirs and all the little hack I saw used a single dir to get the image.
So I wrote the following little bash script.
Put it in .bash_profile if you want a new wallpaper everytime you open a new bash :)