From: Michael Stapelberg Date: Thu, 20 Dec 2012 23:04:29 +0000 (+0100) Subject: i3-dmenu-desktop: don’t add “geany” if “Geany” is already present (Thanks Tai-Lin... X-Git-Tag: 4.5~101 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e0194f07653b7106aa5260e4d7b47ec0c6ab914f;p=i3%2Fi3 i3-dmenu-desktop: don’t add “geany” if “Geany” is already present (Thanks Tai-Lin Chu) --- diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index 20c7fbea..5bf77c2f 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -35,7 +35,7 @@ my $result = GetOptions( 'dmenu=s' => \$dmenu_cmd, 'entry-type=s' => \$entry_type, 'version' => sub { - say "dmenu-desktop 1.2 © 2012 Michael Stapelberg"; + say "dmenu-desktop 1.3 © 2012 Michael Stapelberg"; exit 0; }, 'help' => sub { @@ -250,6 +250,11 @@ for my $app (keys %apps) { if ($entry_type eq 'command' || $entry_type eq 'both') { my ($command) = split(' ', $apps{$app}->{Exec}); + + # Don’t add “geany” if “Geany” is already present. + my @keys = map { lc } keys %choices; + next if lc(basename($command)) ~~ @keys; + $choices{basename($command)} = $app; } } @@ -451,7 +456,7 @@ command) and both (type = both). =head1 VERSION -Version 1.2 +Version 1.3 =head1 AUTHOR