It wasn't me. You can't prove anything.


Gnome desktop background switcher

It turns out that the command below ‘gconftool-2’ does not function properly when executed from within a cron job. There is some environment issue because the script ran fine on the command line no matter what and indeed changed the value of the gnome conf database, but would not implement the change when run from a cron job.

I run this script from the gnome “Startup Applications” mechanism.

Put an integer number of seconds on  the command line. If left blank, it runs once (changes the background) and exists.

Original script found
Bash script to swap out the background of the gnome desktop every x number of seconds.

# found
# Script to randomly set Background from files in a directory

# Directory Containing Pictures

# Command to set Background Image
changeMe() {
# Command to Select a random jpg file from directory
# Delete the *.jpg to select any file but it may return a folder
PIC=$(/bin/ls $DIR/*.jpg | /usr/bin/shuf -n1)
/usr/bin/gconftool-2 -t string -s /desktop/gnome/background/picture_filename $PIC

if [ ! -z $1 ]; then
# Run onece and quit
exit 0

while true ; do
sleep ${seconds}s

No comments: