Adding colors and using sort uniq on declared icons.

This commit is contained in:
sergiotarxz 2022-02-06 04:40:14 +01:00
parent 2751e2334d
commit 211097b541
1 changed files with 39 additions and 6 deletions

View File

@ -35,6 +35,20 @@ use v5.30.0;
use strict;
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 $icon_search_file = $ARGV[1];
@ -47,10 +61,14 @@ while (my $line = <$desktop_filehandle>) {
close $desktop_filehandle;
open my $icon_filehandle, '<', $icon_search_file;
say '
color_wrapper('red');
say << 'EOS';
Known Icons:
-------------
';
EOS
color_wrapper('reset');
while (my $line = <$icon_filehandle>) {
chomp $line;
say $line;
@ -58,15 +76,30 @@ while (my $line = <$icon_filehandle>) {
}
close $icon_filehandle;
say '
color_wrapper('red');
say << 'EOS';
Missing icons:
-------------
';
EOS
color_wrapper('reset');
for my $key (keys %desktop_relation) {
unless ($desktop_relation{$key}) {
say $key;
}
}
EOF
) <(desktopsearch) <(iconsearch $icon_pack)
color_wrapper('red');
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)
}