Dark Light

All I wanted was a background, in Windows, that updated every 10 minutes. Does that seem too much to ask?

Apparently it was, and this is how I had to do it without resorting to external software. Ready?

I have a server that generates an xplanet image every 20 minutes. It used to be my background image when I was in Linux, because linux makes that kind of thing easy. In windows up until XP, though, you have to have “Active Desktop” turned on to use anything other than a bmp as your background, and 1600*1200 backgrounds are non-trivial to shunt around. Plus it loads it on startup and caches it there until shutdown, not optimal for an updating image. The solution to this was a web-page on my server that I set as a background under windows, which said:

[Aquarionics] Aquaricam

body {
background:black url(“maps/pic.png”) no-repeat center middle;
}

resulting in a page that refreshed every 10 minutes. Problem was that it didn’t refresh the image, even with no-cache set on the image itself. Eventually in order to get the image reloaded, I set the script that was generating the image to generate it to a file with a random name between “1.png” and “20.png” and then:

[Aquarionics] Aquaricam

body {
<?PHP
for ($i = 0; $i <= 20; $i++) {

if (file_exists(“maps/$i.png”)){
$number = $i;
}
}
echo “tbackground:tttblack url(“maps/$number.png”) no-repeat center middle;n”;
?>
}

.comments {
position: absolute;
right:0;
bottom:0;
color:#3366FF;
}

This appears to work. But it’s stupid that I have to do it.

Related Posts