Skeeve •---->


Anmeldedatum: 20.04.2006 Beiträge: 1067
|
Verfasst am: 12.02.2007 - 11:10 Titel: Ich will alle icons! (Apfeltalk Reply) |
|
|
Update: Ein kleiner fix. link ist jetzt durch symlink ersetzt. Damit werden gefundene icons nicht doppelt verlinkt und die Originaldateien sind leichter zu lokalisieren.
Ausgehend von diesem Thread auf Apfeltalk, habe ich das folgende perlscript hingeschmiert.
Es durchsucht ab / alle Verzeichnisse nach *.icns Dateien und verlinkt sie in ein neues Directory "all-icons", das auf dem Desktop abgelegt wird.
Code: | #!/usr/bin/perl
use strict;
use warnings;
use File::Find;
my $icondir= $ENV{'HOME'} . '/Desktop/all-icons';
my $count= '';
my $iconcount;
--$count while -e "$icondir$count";
$icondir.= $count;
mkdir $icondir, 0700;
find( sub {
return if -l $_;
return unless s/(\.icns)$//;
my $ext= $1;
my $count='';
--$count while -e "$icondir/$_$count$ext";
symlink $File::Find::name, "$icondir/$_$count$ext";
print STDERR "\r",++$iconcount;
}, '/');
print STDERR "\n"; |
_________________ "All problems are solved in slightly less than half an hour" (Chumbawamba, "Hey Hey We're The Junkies") |
|