X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3-dmenu-desktop;h=3b81cb20ce008097b9f3dbd412f1fd08a6ea2c87;hb=f25c3d5e77f410305efeed97da5ac9adb25491f3;hp=2c54233d02501a57bb776cf7dad0260aea777a4f;hpb=f96ec19df0a30c492d68bb402bf741763332677c;p=i3%2Fi3 diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index 2c54233d..3b81cb20 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -1,7 +1,7 @@ #!/usr/bin/env perl # vim:ts=4:sw=4:expandtab # -# © 2012-2014 Michael Stapelberg +# © 2012 Michael Stapelberg # # No dependencies except for perl ≥ v5.10 @@ -25,7 +25,11 @@ binmode STDERR, ':utf8'; # reads in a whole file sub slurp { my ($filename) = @_; - open(my $fh, '<', $filename) or die "$!"; + my $fh; + if (!open($fh, '<', $filename)) { + warn "Could not open $filename: $!"; + return undef; + } local $/; my $result; eval { @@ -45,7 +49,7 @@ my $result = GetOptions( 'dmenu=s' => \$dmenu_cmd, 'entry-type=s' => \@entry_types, 'version' => sub { - say "dmenu-desktop 1.5 © 2012-2013 Michael Stapelberg"; + say "dmenu-desktop 1.5 © 2012 Michael Stapelberg"; exit 0; }, 'help' => sub { @@ -306,7 +310,7 @@ for my $app (keys %apps) { # }; # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -# ┃ Run dmenu to ask the user for her choice ┃ +# ┃ Run dmenu to ask the user for their choice ┃ # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ # open2 will just make dmenu’s STDERR go to our own STDERR.