From e0194f07653b7106aa5260e4d7b47ec0c6ab914f Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 21 Dec 2012 00:04:29 +0100 Subject: [PATCH] =?UTF-8?q?i3-dmenu-desktop:=20don=E2=80=99t=20add=20?= =?UTF-8?q?=E2=80=9Cgeany=E2=80=9D=20if=20=E2=80=9CGeany=E2=80=9D=20is=20a?= =?UTF-8?q?lready=20present=20(Thanks=20Tai-Lin=20Chu)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i3-dmenu-desktop | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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