I think it's setting a background image in a background environment. Wouldn't be visible to a logged in user. Need to have it attached to a session of some kind for you to actually be able to see something, maybe in your .profile, with a test for whether it's already running. I'm not sure what kind of .profile-like action takes place when your X session starts, but that's where it probably needs to be.<div>
<br></div><div>--Don Ellis</div><div><br><br><div class="gmail_quote">On Thu, Oct 21, 2010 at 5:16 PM, chris <span dir="ltr"><<a href="mailto:c.rheinherren@gmail.com">c.rheinherren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font size="2"><font face="verdana,sans-serif">I'm attempting to have a bash script setup to run as a cronjob but it doesnt.<br><br>Here are the details:<br></font></font>*/2 * * * * /home/chris/scripts/crotate.sh<br>
<font size="2"><font face="verdana,sans-serif">This is the original bash script, I didn't write it but I like it.<br>
<br>#!/bin/bash<br><br>#<br># Rotates GNOME Wallpaper using pictures in $FOLDER<br>
# Run in background: ./rotate.sh &<br># Make sure there are no spaces in picture filenames<br># <a href="http://ubuntu.online02.com/node/37" target="_blank">http://ubuntu.online02.com/node/37</a><br>#<br><br>FOLDER="/home/chris/Pictures/Wallpapers/current" # Change to your directory<br>
cd $FOLDER<br><br>loop () {<br>NUMBER=$(ls -1 | wc -l)<br>RAN=$(($RANDOM%$NUMBER+1))<br>FILE=$(ls -1 | sed -n ${RAN}p)<br>echo $FILE<br>gconftool-2 --set "/desktop/gnome/background/picture_filename" --type string "$FOLDER/$FILE"<br>
sleep 90 # Time between change<br>loop<br>}<br>loop<br><br><br>-------------------<br><br>it works fine if you just run it or put it in screen and run it so you can detach and close out of it while it runs.<br>So I wanted to run this without having a screen or open terminal session going so I removed the loop notes and setup a cron job for it.<br>
<br><br>This is the modified script.<br><br>#!/bin/bash<br><br>FOLDER="/home/chris/Pictures/Wallpapers/current" # Change to your directory<br>cd $FOLDER<br><br>NUMBER=$(ls -1 | wc -l)<br>RAN=$(($RANDOM%$NUMBER+1))<br>
FILE=$(ls -1 | sed -n ${RAN}p)<br>echo $FILE >> /home/chris/scripts/wallpaper.log<br>/usr/bin/gconftool-2 --set "/desktop/gnome/background/picture_filename" --type string "$FOLDER/$FILE"<br><br>
<br>
It does write to my log file that i created. Just fine with the name of
the image that should be the desktop image but there is no change to the
desktop.<br><br><br># m h dom mon dow command<br>PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br>*/2 * * * * /home/chris/scripts/crotate.sh<div><br>------------------<br><br><br>Any help would be great.<br>
<br>Just calling the script ./crotate.sh and it works fine.<br><br>Thanks.<br><br><br>Chris<br></div><br></font></font>
<br>_______________________________________________<br>
Cialug mailing list<br>
<a href="mailto:Cialug@cialug.org">Cialug@cialug.org</a><br>
<a href="http://cialug.org/mailman/listinfo/cialug" target="_blank">http://cialug.org/mailman/listinfo/cialug</a><br>
<br></blockquote></div><br></div>