Code: Select all
#!/usr/bin/perl
use strict;
use warnings;
my $ME = $0; $ME =~ s{.*/}{}; # name of this program
open FONTDIRS, qq(find /usr/share/fonts -name"fonts.dir" |) or
die"$ME: Couldn't open find pipe. $!\n";
print"#-- Files section generated by $ME\n";
print qq(Section"Files"\n);
while (<FONTDIRS>) {
s/\/fonts.dir$/"/;
s/^/ FontPath"/;
print;
}
print qq(endSection\n);
If there is some other/better way to make sure fonts show up, PLMK.