Xfce Forum

Sub domains
 

You are not logged in.

#1 2012-03-14 14:18:41

daniel227
Member
Registered: 2012-03-14
Posts: 34

xfdesktop --reload does not work from gnome-schedule

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

#2 2012-03-14 16:43:22

angstrom
Member
Registered: 2011-08-13
Posts: 267

Re: xfdesktop --reload does not work from gnome-schedule

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

#3 2012-03-14 20:23:00

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: xfdesktop --reload does not work from gnome-schedule

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

#4 2012-03-15 03:16:21

ozjd
Member
From: Hawkesbury NSW Australia
Registered: 2012-02-05
Posts: 560
Website

Re: xfdesktop --reload does not work from gnome-schedule

I used http://rockhopper.dk/linux/software/xfc … hout-cron/ to do the same thing. It follows what the other replies recommend too.

Offline

#5 2012-03-16 23:36:36

daniel227
Member
Registered: 2012-03-14
Posts: 34

Re: xfdesktop --reload does not work from gnome-schedule

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

#6 2012-03-18 08:42:37

daniel227
Member
Registered: 2012-03-14
Posts: 34

Re: xfdesktop --reload does not work from gnome-schedule

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

#7 2012-03-18 12:29:12

eric_the_idiot
Member
Registered: 2011-12-23
Posts: 58

Re: xfdesktop --reload does not work from gnome-schedule

http://apod.nasa.gov/apod/astropix.html
The rss feed would probably be the easiest to parse.

Offline

#8 2012-03-18 14:45:10

daniel227
Member
Registered: 2012-03-14
Posts: 34

Re: xfdesktop --reload does not work from gnome-schedule

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

Board footer

Powered by FluxBB