X-Git-Url: https://git.draconx.ca/gitweb/mpdhacks.git/blobdiff_plain/8016ac3553788a2ed221cea1191030809c00cd6b..331857cbca2513dafa50bf120e9712f1c2c280d0:/mpdmenu.pl diff --git a/mpdmenu.pl b/mpdmenu.pl index ba1a467..963934a 100755 --- a/mpdmenu.pl +++ b/mpdmenu.pl @@ -1,4 +1,13 @@ #!/usr/bin/perl +# +# Copyright © 2008,2010,2012,2019 Nick Bowler +# +# Silly little script to generate an FVWM menu with various bits of MPD +# status information and controls. +# +# License GPLv3+: GNU General Public License version 3 or any later version. +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. use strict; @@ -12,7 +21,8 @@ use constant { }; use utf8; -use encoding 'utf8'; +use open qw(:std :utf8); +binmode(STDOUT, ":utf8"); use Encode; sub cmd @@ -49,7 +59,8 @@ $title = decode_utf8($title) if defined($title);; my $sock = new IO::Socket::INET6( PeerAddr => $host, PeerPort => $port, - Proto => 'tcp' + Proto => 'tcp', + Timeout => 2 ) or die("could not open socket: $!.\n"); binmode($sock, ":utf8");