From 0d354ebd0c85cf5da306ef7c9af4dd518741a502 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 26 Dec 2012 18:31:33 +0100 Subject: [PATCH] i3-dmenu-desktop: skip broken files (no/empty Exec=) but warn about them --- i3-dmenu-desktop | 7 +++++++ 1 file changed, 7 insertions(+) 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.