From: Michael Stapelberg Date: Wed, 26 Dec 2012 17:31:33 +0000 (+0100) Subject: i3-dmenu-desktop: skip broken files (no/empty Exec=) but warn about them X-Git-Tag: 4.5~76 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d354ebd0c85cf5da306ef7c9af4dd518741a502;p=i3%2Fi3 i3-dmenu-desktop: skip broken files (no/empty Exec=) but warn about them --- diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index de4c0be4..3a52faa5 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -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; + } + # 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.