Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin


Automatisk baggrunds rotate

Author:mike - Thu Feb 13 13:34:57 2003

cycle.pl

#!/usr/bin/perl
$path = "/usr/X11R6/share/bgrotate";
open FIL,"$path/current";
$current = <FIL>;
close FIL;

open FIL,"$path/cycle";
$dat = <FIL>; $first = $dat;
while ($dat ne $current)
{
$dat = <FIL>;
}
unless ($next = <FIL>) {$next = $first;};
close(FIL);
$res = system "Esetroot -f $path/$next";
if ($res != 0) { print "could not set bg\n"; exit 1;}
open FIL,">$path/current";
print FIL $next;
close FIL;

Rotate.pl:
#!/usr/bin/perl
$path = "/usr/X11R6/share/bgrotate";
while (1==1)
{
$res = system "$path/cycle.pl";
if ($res !=0) {exit 1;}
sleep 600;
}

Filen "current" skal programmet have skriveadgang til og indeholder navnet paa nuvaerende baggrund. og cycle indeholder listen over de baggrundsbilleder der cycles imellem.
Copyright(c) Unifix.org 2002-2011


Dashboard - News - Search - List - About - Admin
 
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk