You are not logged in.
i have a little shell script to update my desktop background from the internet.
when i run it manually it works nicely, but when i run it automatically once an hour via gnome-schedule (works on xfce), the last bit, reloading the desktop, does not work.
what to do?
i heard that cron jobs (i think gnome schedule usues cron) are run as root.
i also heard that xfdesktop is tricky with that - but the explanation went 404.
i also found an old article from 2008, telling me to manually edit crontab... haven't tried it
i also found the killall solution, but i don't want to use it because it makes my screen go white for a moment.
i tried various combinations of running the last command or the whole script as sudo -u myusername, but to no avail.
what now?
asks a semi-noob-nerd.
Offline
There was a simillar discussion on the mailing list : http://mail.xfce.org/pipermail/xfce/201 … hread.html, the subject "xfdesktop in a cron job"
http://mail.xfce.org/pipermail/xfce/201 … 29508.html
Don't remember if it was resolved or not ...
Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...
Offline
I have a similar script, written by me sometime ago, using
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "$BG"
Using xfconf and not xfdesktop --reload is cited as correct also in the xfce mailing list links that angstrom posted.
It should work with your user crontab (specifying DISPLAY variable) , or if you want something really not elegant but simple , you could just add to your autostart a script with an endless loop and a sleep 3600 :-P
Offline
I used http://rockhopper.dk/linux/software/xfc … hout-cron/ to do the same thing. It follows what the other replies recommend too.
Offline
thanks for all answers, they were really helpful.
the xconf thing didn't work, i guess because the image name is the same all the time.
instead of writing a script to rename it by date, i went for simple -
now i still have a half hourly cron job to donload the picture (because that's how often it gets updated) plus an endless looped script that reloads the desktop every ten minutes. not elegant, not perfect, but it works. i guess most things in life are like that...
----this for cron----
cd ~/Pictures
httrack -T10 -R5 --get http://static.die.net/earth/mollweide/1024.jpg
----and this as an endless shell script----
while : ; do
sleep 120
xfdesktop --reload
sleep 480
done
# reloads the desktop every 10min. 2min wait at boot, reload, 8min wait
mayb i'll work on it some more.
and search for more planet earth imagery.
nice forum, thanks again
:-)
Offline
ps:
does anybody know where/how to find regularly updated imagery (of earth, moon, sun, stars, some particular place, anything...) that can be downloaded easily?
Last edited by daniel227 (2012-03-18 08:43:29)
Offline
http://apod.nasa.gov/apod/astropix.html
The rss feed would probably be the easiest to parse.
Offline
thanx eric_the_idiot.
very beautiful pictures, though i had something else in mind.
more like showing something from the same angle as it changes in real time...
more suitable for automation.
but i've been browsing the apod archives foe quite a while now, reallly nice stuff.
more suggestions?
Offline
[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 545.7 KiB (Peak: 546.55 KiB) ]