Adding colors and using sort uniq on declared icons.
This commit is contained in:
parent
2751e2334d
commit
211097b541
45
functions.sh
45
functions.sh
@ -35,6 +35,20 @@ use v5.30.0;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
use Term::ANSIColor;
|
||||||
|
|
||||||
|
$SIG{INT} = sub {
|
||||||
|
color_wrapper('reset');
|
||||||
|
};
|
||||||
|
|
||||||
|
sub color_wrapper {
|
||||||
|
print color(shift) if -t STDOUT || $ENV{TOASTER_COLOR};
|
||||||
|
}
|
||||||
|
|
||||||
|
color_wrapper('yellow');
|
||||||
|
say 'This is the Toasters Icon Pack Missing Icons Tool';
|
||||||
|
color_wrapper('reset');
|
||||||
|
|
||||||
my $desktop_search_file = $ARGV[0];
|
my $desktop_search_file = $ARGV[0];
|
||||||
my $icon_search_file = $ARGV[1];
|
my $icon_search_file = $ARGV[1];
|
||||||
|
|
||||||
@ -47,10 +61,14 @@ while (my $line = <$desktop_filehandle>) {
|
|||||||
close $desktop_filehandle;
|
close $desktop_filehandle;
|
||||||
|
|
||||||
open my $icon_filehandle, '<', $icon_search_file;
|
open my $icon_filehandle, '<', $icon_search_file;
|
||||||
say '
|
|
||||||
|
color_wrapper('red');
|
||||||
|
say << 'EOS';
|
||||||
|
|
||||||
Known Icons:
|
Known Icons:
|
||||||
-------------
|
-------------
|
||||||
';
|
EOS
|
||||||
|
color_wrapper('reset');
|
||||||
while (my $line = <$icon_filehandle>) {
|
while (my $line = <$icon_filehandle>) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
say $line;
|
say $line;
|
||||||
@ -58,15 +76,30 @@ while (my $line = <$icon_filehandle>) {
|
|||||||
}
|
}
|
||||||
close $icon_filehandle;
|
close $icon_filehandle;
|
||||||
|
|
||||||
say '
|
color_wrapper('red');
|
||||||
|
say << 'EOS';
|
||||||
|
|
||||||
Missing icons:
|
Missing icons:
|
||||||
-------------
|
-------------
|
||||||
';
|
EOS
|
||||||
|
color_wrapper('reset');
|
||||||
for my $key (keys %desktop_relation) {
|
for my $key (keys %desktop_relation) {
|
||||||
unless ($desktop_relation{$key}) {
|
unless ($desktop_relation{$key}) {
|
||||||
say $key;
|
say $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
color_wrapper('red');
|
||||||
) <(desktopsearch) <(iconsearch $icon_pack)
|
say << 'EOS';
|
||||||
|
|
||||||
|
Not missing in your system icons:
|
||||||
|
-------------
|
||||||
|
EOS
|
||||||
|
color_wrapper('reset');
|
||||||
|
for my $key (keys %desktop_relation) {
|
||||||
|
if ($desktop_relation{$key}) {
|
||||||
|
say $key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
) <(desktopsearch) <(iconsearch $icon_pack | sort | uniq)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user