be silent unless told otherwise

This commit is contained in:
Peter J. Holzer 2014-12-01 13:58:03 +01:00
parent 8d8a223612
commit 98fca3e86b
1 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@ use File::Slurp;
use Data::Dumper;
my $launcher = $ARGV[0];
my $verbose = 0;
my $launcher_dir = "$ENV{HOME}/.config/xfce4/panel/launcher-$launcher";
@ -30,7 +31,7 @@ for my $xterm_script (@xterm_scripts) {
if ($desktop_files{$name}{content_fields}{Icon} ne $icon_file) {
$desktop_files{$name}{content_fields}{Icon} = $icon_file;
replace($desktop_files{$name});
say STDERR "replaced desktop entry $desktop_files{$name}{filename} for $name";
say STDERR "replaced desktop entry $desktop_files{$name}{filename} for $name" if $verbose;
}
} else {
@ -47,7 +48,7 @@ for my $xterm_script (@xterm_scripts) {
current => 1
};
replace($desktop_files{$name});
say STDERR "created new desktop entry $desktop_files{$name}{filename} for $name";
say STDERR "created new desktop entry $desktop_files{$name}{filename} for $name" if $verbose;
}
}
@ -55,7 +56,7 @@ $desktop_files{XTerm}{current} = 1; # we always want that
for my $name (sort keys %desktop_files) {
unless ($desktop_files{$name}{current}) {
say STDERR "deleting obsolete desktop entry $desktop_files{$name}{filename} for $name";
say STDERR "deleting obsolete desktop entry $desktop_files{$name}{filename} for $name" if $verbose;
unlink($desktop_files{$name}{filename});
}
}