]> git.draconx.ca Git - mpdhacks.git/blobdiff - mpdmenu.pl
mpdmenu: Use IO::Socket::INET6 to support IPv6 as well as IPv4.
[mpdhacks.git] / mpdmenu.pl
index f88451d12340c0021fa124521511397cb2501141..7a48c20d0c4a0104645004392e27d28313afa12a 100755 (executable)
@@ -3,7 +3,7 @@
 use strict;
 
 use Getopt::Long;
-use IO::Socket;
+use IO::Socket::INET6;
 
 use constant {
        MPD_MJR_MIN => 0,
@@ -46,7 +46,7 @@ $artist = decode_utf8($artist) if defined($artist);
 $title  = decode_utf8($title)  if defined($title);;
 
 # Connect to MPD.
-my $sock = new IO::Socket::INET(
+my $sock = new IO::Socket::INET6(
        PeerAddr => $host,
        PeerPort => $port,
        Proto => 'tcp'
@@ -138,7 +138,7 @@ if (defined $album) {
                my $key      = $_;
                my $a_album  = sanitise($key);
 
-               open THUMB, "-|", "$FVWM/thumbnail.sh",
+               open THUMB, "-|", "$FVWM/scripts/thumbnail.sh",
                                         "--small", "--music", $albums{$key};
                my $thumb = <THUMB>;
                close THUMB;
@@ -154,7 +154,7 @@ if (defined $album) {
                cmd("DestroyFunc MakeMenuMPDArt_$i");
                cmd("AddToFunc   MakeMenuMPDArt_$i
                     + I DestroyMenu MenuMPDArt_$i
-                    + I -PipeRead \"exec $FVWM/mpdmenu.pl "
+                    + I -PipeRead \"exec $FVWM/scripts/mpdmenu.pl "
                           ."--menu MenuMPDArt_$i "
                           ."--album  ".shellify($key, 1)." "
                           ."--artist ".shellify($artist, 1)."\"");
@@ -234,7 +234,7 @@ if (defined $album) {
                $t_artist = sanitise($t_artist);
                $t_title  = sanitise($t_title);
 
-               open THUMB, "-|", "$FVWM/thumbnail.sh",
+               open THUMB, "-|", "$FVWM/scripts/thumbnail.sh",
                                         "--small", "--music", $t_file;
                my $thumb = <THUMB>;
                close(THUMB);
@@ -276,7 +276,7 @@ if (defined $album) {
        }
        die("Failed data query\n") unless (keys(%entry) > 0);
 
-       open THUMB, "-|", "$FVWM/thumbnail.sh",
+       open THUMB, "-|", "$FVWM/scripts/thumbnail.sh",
                                 "--image", "--music",  $entry{file};
        my $thumb = <THUMB>;
        my $scan  = <THUMB>;
@@ -333,14 +333,14 @@ if (defined $album) {
        cmd("DestroyFunc MakeMenuMPDTitle");
        cmd("AddToFunc   MakeMenuMPDTitle
             + I DestroyMenu MenuMPDTitle
-            + I -PipeRead \"exec $FVWM/mpdmenu.pl "
+            + I -PipeRead \"exec $FVWM/scripts/mpdmenu.pl "
                           ."--menu MenuMPDTitle "
                           ."--title ".shellify($entry{Title}, 1)."\"");
 
        cmd("DestroyFunc MakeMenuMPDAlbum");
        cmd("AddToFunc   MakeMenuMPDAlbum
             + I DestroyMenu MenuMPDAlbum
-            + I -PipeRead \"exec $FVWM/mpdmenu.pl "
+            + I -PipeRead \"exec $FVWM/scripts/mpdmenu.pl "
                           ."--menu MenuMPDAlbum "
                           ."--album  ".shellify($entry{Album}, 1)." "
                           ."--artist ".shellify($entry{Artist}, 1)."\"");
@@ -348,7 +348,7 @@ if (defined $album) {
        cmd("DestroyFunc MakeMenuMPDArtist");
        cmd("AddToFunc   MakeMenuMPDArtist
             + I DestroyMenu MenuMPDArtist
-            + I -PipeRead \"exec $FVWM/mpdmenu.pl "
+            + I -PipeRead \"exec $FVWM/scripts/mpdmenu.pl "
                           ."--menu MenuMPDArtist "
                           ."--artist ".shellify($entry{Artist}, 1)."\"");