Linux Wallpaper Folder XML Creater
#!/usr/bin/perl
use strict;
if (!$ARGV[0]) {
print “USAGE: [perl] “, __FILE__,”
exit();
}
opendir(DIR, $ARGV[0]);
my @files = readdir(DIR);
closedir(DIR);
if ($ARGV[1] ne ”) {
my $ext = $ARGV[1] ;
$ext = join(‘|’, split /,/, $ARGV[1]);
@files = grep /\.($ext)$/, @files;
} else {
@files = grep /\.jpg$/, @files;
}
open OUT, “>$ARGV[0]/background.xml”;
print OUT q*
*;
for(my $i=1; $i<=$#files; $i++) {
print OUT qq*
*;
}
print OUT qq*
*;
print OUT ‘’;
close OUT;

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home