From: Michael Stapelberg Date: Sat, 16 Mar 2013 23:59:18 +0000 (+0100) Subject: i3-dmenu-desktop: improve error message when dmenu cannot be found X-Git-Tag: 4.5.1~2^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a7ba8931d5b0bfc1bcdcca05a75afe470b65f0f7;p=i3%2Fi3 i3-dmenu-desktop: improve error message when dmenu cannot be found fixes #984 --- diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index 085c4f1c..e0a35b8d 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -306,7 +306,14 @@ for my $app (keys %apps) { # open2 will just make dmenu’s STDERR go to our own STDERR. my ($dmenu_out, $dmenu_in); -my $pid = open2($dmenu_out, $dmenu_in, $dmenu_cmd); +my $pid = eval { + open2($dmenu_out, $dmenu_in, $dmenu_cmd); +} or do { + print STDERR "$@"; + say STDERR "Running dmenu failed. Is dmenu installed at all? Try running dmenu -v"; + exit 1; +}; + binmode $dmenu_in, ':utf8'; binmode $dmenu_out, ':utf8';