cvsimport
[fvwm-themes.git] / devel / bin / random-migo-background
blobfa5cf4fbad21d10823cd176c86e8e5bf7e52315d
1 #!/usr/bin/perl -w
3 sub getRandomColor () {
4 sprintf("#%06x", int(rand(256*256*256)));
7 my $colorN = shift;
8 $colorN = 3 unless defined $colorN && $colorN =~ /^\d+$/;
10 my @colors = ();
11 # don't use this perl 5.004 "my" construct in public scripts
12 for my $i (1 .. $colorN) { push @colors, getRandomColor(); }
13 # don't use this perl 5.005 "for" construct in public scripts
14 #push @colors, getRandomColor() for (1 .. $colorN);
16 my $colorStr = join(',', @colors);
17 print(qq(Colors used: "$colorStr"\n));
18 my $dir = `fvwm-themes-config --show-dir --theme migo`; chomp($dir);
19 system(qq(fvwm-themes-images --in-file $dir/images/background/trefoil.xpm --setroot --colorize --colorize-colors "$colorStr"));