i3-dmenu-desktop: skip broken files (no/empty Exec=) but warn about them

next
Michael Stapelberg 2012-12-26 18:31:33 +01:00
parent ba1b3a3240
commit 0d354ebd0c
1 changed files with 7 additions and 0 deletions

View File

@ -221,6 +221,13 @@ for my $app (keys %apps) {
next if (!exists($apps{$app}->{Type}) ||
$apps{$app}->{Type} ne 'Application');
# Skip broken files (Type=application, but no Exec key).
if (!exists($apps{$app}->{Exec}) ||
$apps{$app}->{Exec} eq '') {
warn 'File ' . $apps{$app}->{_Location} . ' is broken: it contains Type=Application, but no Exec key/value pair.';
next;
}
# Dont 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.