'dmenu=s' => \$dmenu_cmd,
'entry-type=s' => \@entry_types,
'version' => sub {
- say "dmenu-desktop 1.3 © 2012 Michael Stapelberg";
+ say "dmenu-desktop 1.4 © 2012 Michael Stapelberg";
exit 0;
},
'help' => sub {
# 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';
# XXX: Icons are not implemented. Is the complexity (looking up the path if
# only a name is given) actually worth it?
#$exec =~ s/%i/--icon $icon/g;
+$exec =~ s/%i//g;
# location of .desktop file
$exec =~ s/%k/$location/g;
=head1 VERSION
-Version 1.3
+Version 1.4
=head1 AUTHOR