]> git.draconx.ca Git - fvwmconf.git/blobdiff - scripts/mpdmenu.pl
MPD script updates.
[fvwmconf.git] / scripts / mpdmenu.pl
index d477ca3bdfb01eb69d2bbc807ea958ef9aa0a2b0..c36fad7ab64e7fa051a1104e4cc2183ede6058ae 100755 (executable)
@@ -1,4 +1,13 @@
 #!/usr/bin/perl
+#
+# Copyright © 2018,2010,2012,2019 Nick Bowler
+#
+# Silly little script to generate an FVWM menu with various bits of MPD
+# status information and controls.
+#
+# License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+# This is free software: you are free to do what the fuck you want to.
+# 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");