Xfce Forum

Sub domains
 

You are not logged in.

#1 2010-10-18 15:55:08

ka9qlq
Member
From: Columbus, IN
Registered: 2010-09-25
Posts: 17
Website

[Solved] How to auto update backgrounds

I auto download weather images to a folder. I'd  like to set up a way to rotate/refresh these as back ground images. Ideas?

Offline

#2 2010-10-18 16:26:42

Pindakoe
Member
From: NL
Registered: 2003-11-26
Posts: 110

Re: [Solved] How to auto update backgrounds

There have been several discussions on this forum over the years (but note that 4.6 works  different than 4.4). I use following script which chooses a random image every 15 minutes from a long list:

# Wall paper changer for Xfce 4.6

MONITOR=${1:-0}
export DISPLAY=":0.0"
PROPERTY="/backdrop/screen0/monitor${MONITOR}/image-path"    # list with wallpapers
IMAGE_PATH=`xfconf-query -c xfce4-desktop -p ${PROPERTY}`
while [ 1 ]; do
  sleep 15m                            # Will start with new wallpaper anyway
  xfconf-query -c xfce4-desktop -p ${PROPERTY} -s ""        # Zero list
  # Re-set list, thus select random wallpaper
  xfconf-query -c xfce4-desktop -p ${PROPERTY} -s "${IMAGE_PATH}"
done

The file $IMAGE_PATH looks like:

# xfce backdrop list
file1.jpg
file2.jpg

These sould be complete path/filenames.

I have never looked into setting a certain image as background (which is what you may want); you could just overwrite the image with the new contents and then refresh it

Offline

#3 2010-10-19 17:20:47

ka9qlq
Member
From: Columbus, IN
Registered: 2010-09-25
Posts: 17
Website

Re: [Solved] How to auto update backgrounds

Thanks, I'm trying to figure your cove out. Is it BASH or Pearl?

I have never looked into setting a certain image as background (which is what you may want); you could just overwrite the image with the new contents and then refresh it

Ya that's kinda what I did in IceWM like 4-5 years back but I don't keep notes well.

Settings/Desktop/Background lets you make an image list like kde but there's no settings on how often to change the background (I'm ASSuMEing it will rotate them) And will it refresh the image?

Offline

#4 2010-10-20 17:56:00

Pindakoe
Member
From: NL
Registered: 2003-11-26
Posts: 110

Re: [Solved] How to auto update backgrounds

The Xfce Settings/background cannot automatically change, hence the script (in BASH). I have a second script which once a day traverses some directories and then builds an image lis.

Offline

#5 2010-10-20 19:13:42

herd
Member
From: Germany
Registered: 2006-05-18
Posts: 143
Website

Re: [Solved] How to auto update backgrounds

My wallpaper list does not change often.

With 4.6.1 and later, xfdesktop --reload works again.
So after a crontab -e, typing in:

5 * * * * DISPLAY=:0.0 xfdesktop --reload # Refresh backdrop every 5 min past the hour

will do the job.

Offline

#6 2010-10-20 19:36:22

ka9qlq
Member
From: Columbus, IN
Registered: 2010-09-25
Posts: 17
Website

Re: [Solved] How to auto update backgrounds

DISPLAY=:0.0 xfdesktop --reload works great!
Thanks guys

Offline

#7 2011-10-04 16:34:53

StephenH
Member
From: Wake Forest, North Carolina
Registered: 2011-09-10
Posts: 16
Website

Re: [Solved] How to auto update backgrounds

Thanks. This has been puzzling me since I switched to XFCE several weeks back. I added a cron job to do execute this every 15 minutes. The command works great when I tested it in a terminal.


StephenH

"We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach
http://pilgrim-wanderings.blogspot.com

Offline

#8 2011-10-04 20:17:10

Sideburns
Member
From: Camarillo, CA
Registered: 2011-03-30
Posts: 279
Website

Re: [Solved] How to auto update backgrounds

Even easier is to install and use wallpapoz.  Among other things, you can have different backgrounds for different workspaces.  (That's what I originally wanted, but I found that having one list of backgrounds changing randomly was more interesting.)  And, the programmer is very good about responding to emails.


Registered Linux user #470359
Permanently recovered BOFH
Any advice in this post is worth exactly what you paid for it.

Offline

#9 2011-10-04 20:56:32

StephenH
Member
From: Wake Forest, North Carolina
Registered: 2011-09-10
Posts: 16
Website

Re: [Solved] How to auto update backgrounds

Given that I did not necessarily want each workspace to have a different background, this command in a cron job is simple and does not require adding a software package to accomplish. However, each is free to choose his or her own option. At least we have a choice. big_smile

Last edited by StephenH (2011-10-04 21:17:03)


StephenH

"We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach
http://pilgrim-wanderings.blogspot.com

Offline

#10 2011-10-05 17:19:46

Pindakoe
Member
From: NL
Registered: 2003-11-26
Posts: 110

Re: [Solved] How to auto update backgrounds

The only minor issue with using cron is that this command will also run when you are not logged on. This then results in an error message in your syslog (which you can ignore -- it doesn't hurt)

Offline

#11 2011-10-05 17:42:10

StephenH
Member
From: Wake Forest, North Carolina
Registered: 2011-09-10
Posts: 16
Website

Re: [Solved] How to auto update backgrounds

For me, my desktop system is always logged on (screen locked when not active). My netbook is also always logged on and either active or suspended. Therefore, I do not think I will have to worry about an error message. That being said, I appreciate the information. I'll know to expect it if I should happen to log off and forget to log back on sometime. smile


StephenH

"We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach
http://pilgrim-wanderings.blogspot.com

Offline

#12 2011-10-05 23:09:47

ToZ
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 956

Re: [Solved] How to auto update backgrounds

Pindakoe wrote:

The only minor issue with using cron is that this command will also run when you are not logged on. This then results in an error message in your syslog (which you can ignore -- it doesn't hurt)

Try the following to suppress the error message:

5 * * * * DISPLAY=:0.0 xfdesktop --reload > /dev/null 2>&1

Offline

#13 2011-10-06 01:22:20

StephenH
Member
From: Wake Forest, North Carolina
Registered: 2011-09-10
Posts: 16
Website

Re: [Solved] How to auto update backgrounds

Or, using a graphical tool, gnome-schedule, the "Suppress output" might also work. It does still change the background so at least it doesn't break anything (that I can see anyway).


StephenH

"We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach
http://pilgrim-wanderings.blogspot.com

Offline

#14 2013-03-13 15:30:24

jimwg
Member
Registered: 2011-12-11
Posts: 54

Re: [Solved] How to auto update backgrounds

Greetings!

A great education here!
Is there anyway to trick it to do change time settings down to ten seconds? .1 doesn't work!

Thanks!

Jim in NYC

Offline

Board footer

Powered by FluxBB