aboutsummaryrefslogtreecommitdiff
path: root/i3-dmenu-desktop
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2012-12-21 00:04:29 +0100
committerMichael Stapelberg <michael@stapelberg.de>2012-12-21 00:04:29 +0100
commite0194f07653b7106aa5260e4d7b47ec0c6ab914f (patch)
tree3857af75313c5bb44c5bf926e14febb1f51fc599 /i3-dmenu-desktop
parentb8939e6c9cb04e3903e78fe01aa7e3f2547ed815 (diff)
downloadi3-e0194f07653b7106aa5260e4d7b47ec0c6ab914f.tar.gz
i3-e0194f07653b7106aa5260e4d7b47ec0c6ab914f.zip
i3-dmenu-desktop: don’t add “geany” if “Geany” is already present (Thanks Tai-Lin Chu)
Diffstat (limited to 'i3-dmenu-desktop')
-rwxr-xr-xi3-dmenu-desktop9
1 files 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