Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing The Background 3

Status
Not open for further replies.

iaresean

Programmer
Mar 24, 2003
570
ZA
Hey there all you unix gurus!

I have quite a tough little question that needs answering. Answers will be rewarded.

I have a nice collection of calvin and hobbes comics on my box, enough to display one a day for the year. At the moment I am trying to write a script that will be executed via cron.daily (I think) that will change my desktop background to the next calvin and hobbes picture.

How would I do this?

My pics have the following naming convention:
ch0001.gif ch0002.gif ch0003.gif ...... ch0365.gif

Any ideas are greatly appreciated, even negative ones. If it can't be done please let me know.

Thanks a bunch.
Sean.
 
what is your Unix? Linux? if so, which is your desktop environment? gnome, xfce4, kde?
 
Sorry, I forgot to mention that. :-(

I am using the gnome environment within Linux Red Hat 9.

Thanks a lot.

Sean.
 
OK, this may not be the most elegant solution, but I have used it often.

I make a copy of one of the pictures and put it in a common location:
/home/hemo/potd/image.gif

I'll set that image to my background image.

Then I use a daily cron job copy a new image over that one every day. You could write a small script that would do each image in succession.

 
Hemo is on the right track. To copy your actual image to your "dummy" image location each day you would use

cp /location/of/ch0`date +%j`.gif /location/of/dummy/image.gif

Greg.
 
Thanks alot guys!
It is much appreciated. :)
Sean.
 
It works ok I put the following line in my crontab:
00 10 * * * /root/background/changeback.sh

This should execute my changeback script at 10:00am every day right? I tried the following line in my crontab, just to see if everything was working:
* * * * * /root/background/changeback.sh

This ran the script every minute. The problem is, I had to logout and log back in again in order to see the changed background. Is there a refresh command of any sorts that anyone might know of to help me?

Thanks a bunch.
Sean.
 
There must be somewhere. The background iamge is loaded into memory at desktop load time, so changing the file while in the desktop isn't triggering a reload.

I don't think touching the file will help. I've been digging for the call or command to 'reload' the desktop, but coming up empty. There has to be one, since you can select new backgrounds in the control center and 'apply' them which will load the new image immediately without a logout/login.

 
On other *NIX, I used to reload with background images with 'xv' - not sure if it could be of any help, but.....

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thats a good point Hemo, and I appreciate all the time you guys have spent on this thing.

There has to be some sort of command that causes the background to refresh/reload. I am gonna do a bit more of an investigation. I will get back with any results.
 
I was searching about this issue.
The problem is: when you change the background image you use -in gnome- the util &quot;/usr/bin/gnome-background-propierties&quot; and you can run it directly but not as scripts, so it has embebed the refresh/reload action, but can not be scripted.

I use xfce4 and in order the change the bg image you use &quot;/usr/bin/xfce-setting-show backdrop&quot; and it does the same thing, but it can not be scripted.

If anyone found the way to script this issue, he will get a lots stars!! :eek:)

Cheers.
 
set a star at vgerh99's post!

-> disable Background or set to no Background (blank/black backdrop)
-> load image with xv, xv can be scripted... ;)

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - &quot;Home of the Whopper&quot;, oh no, &quot;Home of the Oktoberfest&quot; ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Thanks for all the responses guys,

I really appreciate it. It definitely feels like we getting closer to the solution. I agree with Chacalinc - loads of stars should be given to the person that solves this one.

Cheers;
Sean.
 
no xv on your system?

ftp://rpmfind.net/linux/redhat/updates/5.1/en/os/i386/jpeg/xv-3.10a-12.i386.rpm

ok, it's a little bit older but I think this works fine (it is working fine on Solaris 8... ;) )

on SunOS 4.x there was a backdroploader xloadimage....

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - &quot;Home of the Whopper&quot;, oh no, &quot;Home of the Oktoberfest&quot; ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Code:
XV(l)                                                       XV(l)



NAME
       xv - interactive image display for the X Window System

SYNTAX
       xv [options] [filename[filename...]]

DESCRIPTION
       The  xv  program  displays  images in the GIF, JPEG, TIFF,
       PBM, PGM,  PPM,  X11  bitmap,  Utah  Raster  Toolkit  RLE,
       PDS/VICAR, Sun Rasterfile, BMP, PCX, IRIS RGB, XPM, Targa,
       XWD, possibly PostScript, and PM formats  on  workstations
       and terminals running the X Window System, Version 11.

       The  documentation  for  XV  is  now distributed only as a
       PostScript file, as it has  gotten  enormous,  and  is  no
       longer very well suited to the 'man' page format.  Print a
       copy of the (100-ish page) manual found in docs/xvdocs.ps.
       If  you  are  unable  to  get  the manual to print on your
       printer, you may purchase a printed copy of the XV manual.
       Click on 'About XV' in the program to get further informa¡
       tion.

       If you don't have the PostScript file, it is part  of  the
       standard  XV distribution, the latest version of which can
       be obtained via anonymous ftp  from  ftp.cis.upenn.edu  in
       the directory pub/xv


AUTHOR
       John Bradley



Rev. 3.10                2 December 1994                    XV(l)

xv is included on just about every linux distro I know of, although it may not install by default. I'm not at a X workstation right now or I could try it, but so far it looks like the best bet.
 
Damn, I came across this command:
xrefresh

Which refreshes the window system, but not the background.


Sean.
psa.gif
 
sean, which Unix do you run and which Windowmanager?

I just tried to set no background in &quot;Bluecurve&quot; (RedHat 9), but no background means in thos Windowmanager blue background; you can load images to the background using xview (simple version of xv) but you can not see them...

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - &quot;Home of the Whopper&quot;, oh no, &quot;Home of the Oktoberfest&quot; ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top