Monday, October 02, 2006

random desktop background in gnome

#!/bin/bash
dipath="/media/Stuff/Pictures/Wallpapers"
dicount=`find "$dipath"|tr -d ' '|wc -w`
dilist=`find "$dipath" -printf "%p#"`
dinumber=`expr $RANDOM % $dicount`
difile=`echo $dilist|cut -d "#" -f $dinumber`
gconftool-2 -t "str" --set /desktop/gnome/background/picture_filename "$difile"

A link on the panel or desktop for this script, and on each click a random background..

No comments: