i3-dmenu-desktop: don’t add “geany” if “Geany” is already present (Thanks Tai-Lin Chu)

This commit is contained in:
Michael Stapelberg 2012-12-21 00:04:29 +01:00
parent b8939e6c9c
commit e0194f0765
1 changed files with 7 additions and 2 deletions

View File

@ -35,7 +35,7 @@ my $result = GetOptions(
'dmenu=s' => \$dmenu_cmd, 'dmenu=s' => \$dmenu_cmd,
'entry-type=s' => \$entry_type, 'entry-type=s' => \$entry_type,
'version' => sub { 'version' => sub {
say "dmenu-desktop 1.2 © 2012 Michael Stapelberg"; say "dmenu-desktop 1.3 © 2012 Michael Stapelberg";
exit 0; exit 0;
}, },
'help' => sub { 'help' => sub {
@ -250,6 +250,11 @@ for my $app (keys %apps) {
if ($entry_type eq 'command' || $entry_type eq 'both') { if ($entry_type eq 'command' || $entry_type eq 'both') {
my ($command) = split(' ', $apps{$app}->{Exec}); my ($command) = split(' ', $apps{$app}->{Exec});
# Dont add “geany” if “Geany” is already present.
my @keys = map { lc } keys %choices;
next if lc(basename($command)) ~~ @keys;
$choices{basename($command)} = $app; $choices{basename($command)} = $app;
} }
} }
@ -451,7 +456,7 @@ command) and both (type = both).
=head1 VERSION =head1 VERSION
Version 1.2 Version 1.3
=head1 AUTHOR =head1 AUTHOR