QODS ec

Saturday, July 10, 2004

GNOME: randomized splash-screen

GNOME Hacks

Posted by mail@thorsten-alge.de on 2004-07-07 07:59:38 +(2)-

This script changes the splash-image randomized to one of the files, listed in
$base_dir.
I know, its not very nice, but copy it to your gnome-autostart folder and it
works.

#!/usr/bin/perl -w
#
use strict;
use warnings;

my $base_dir = "/usr/share/images/desktop-base/";

sub main {
my @images;
my $sum_images = 0;
my $no_images = 0;
my $ret_code = 0;

opendir(DIR, $base_dir);
@images = readdir(DIR);
closedir(DIR);

foreach(@images) { # find and delete . or .. from array
if ($_ eq ('.' or '..')) {
splice(@images,$sum_images,1);
$sum_images--;
}
$sum_images++;
}

$no_images = int(rand($sum_images)+1);

exec("gconftool-2 --set --type string
/apps/gnome-session/options/splash_image $images[$no_images]");
}

&main();

__END__

0 Comments:

Post a Comment

<< Home


Get Firefox!