'dmenu=s' => \$dmenu_cmd,
'entry-type=s' => \$entry_type,
'version' => sub {
- say "dmenu-desktop 1.1 © 2012 Michael Stapelberg";
+ say "dmenu-desktop 1.2 © 2012 Michael Stapelberg";
exit 0;
},
'help' => sub {
if ($key =~ /^Name/) {
$names{$key} = $value;
} elsif ($key eq 'Exec' ||
- $key eq 'TryExec') {
+ $key eq 'TryExec' ||
+ $key eq 'Type') {
$apps{$base}->{$key} = $value;
} elsif ($key eq 'NoDisplay' ||
$key eq 'Hidden' ||
for my $app (keys %apps) {
my $name = $apps{$app}->{Name};
+ # Don’t try to use .desktop files which don’t have Type=application
+ next if (!exists($apps{$app}->{Type}) ||
+ $apps{$app}->{Type} ne 'Application');
+
# Don’t offer apps which have NoDisplay == true or Hidden == true.
# See http://wiki.xfce.org/howto/customize-menu#hide_menu_entries
# for the difference between NoDisplay and Hidden.
=head1 VERSION
-Version 1.1
+Version 1.2
=head1 AUTHOR