Inspired by the other thread, i found a script to change the background every hour.
The thing is, it doesn't work from cron.hourly. If i run it from the shell it works nicely, but doesn't i run it from sudo. i know its running because if put an echo in there it appears, but the background doesn't change. ive given it 700, 755 and 777 permissions, all with the same result.
heres the script,
Code:
#!/bin/bash
# script: change_backgrounds.sh - bash version
# version 2007.3.7
# description: randomly replace gnome background with one from a directory
# credits: David Loschiavo [http://www.djlosch.com], Steven Van Ingelgem
# license: GPL
bg_path=/usr/autoBG
extensions="jpg png gif jpeg JPG GIF PNG"
temp_bg_list=/tmp/bg_change_list
rm -f $temp_bg_list
for extension in $extensions
do
find $bg_path -iregex ".*.$extension" >> "$temp_bg_list"
done
cnt=`wc -l "$temp_bg_list" | cut -f1 -d" "`
all_bgs=`echo \`expr $RANDOM % $cnt\``
selected_bg=`head -n$all_bgs "$temp_bg_list" | tail -n1`
logger "Changed desktop to: $selected_bg"
gconftool-2 -t string -s /desktop/gnome/background/picture_filename "$selected_bg"
exit 0
from what i gather, it is trying to work but the path /usr/autoBG is not working as it should when run by root. im not experienced enough with this to figure it out, so any advice would be great.