i3-dmenu-desktop: improve error message when dmenu cannot be found

fixes #984
This commit is contained in:
Michael Stapelberg 2013-03-17 00:59:18 +01:00
parent 203f5dafd0
commit a7ba8931d5
1 changed files with 8 additions and 1 deletions

View File

@ -306,7 +306,14 @@ for my $app (keys %apps) {
# open2 will just make dmenus STDERR go to our own STDERR. # open2 will just make dmenus STDERR go to our own STDERR.
my ($dmenu_out, $dmenu_in); 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_in, ':utf8';
binmode $dmenu_out, ':utf8'; binmode $dmenu_out, ':utf8';