On Fri, 7 May 2004 18:55:44 +0200, Antoine Marmignon <[EMAIL PROTECTED]> wrote:

I've been using mpd (http://www.musicpd.org/) for quite time and I've
created fvwm menus to control it, using fvwm-menu-directory to add files to
the playlists.


I'd like to know how it would actually possible to create a dynamic menu
showing the content of the current playlist.

The command 'mpc playlist' outputs the playlist like this:
# mpc playlist
#1) Artist - Song 1
#2) Artist - Song 2
#3) Artist - Song 3
#4) Artist - Song 4

It is possible to redirect the output of the 'mpc playlist' command to a
file then use the Read command but i'd like to make it more simple (using a
PipeRead)

i played a little bit with perl and xmmsctrl: <code> #!/usr/bin/perl print 'DestroyMenu MenuXmms AddToMenu MenuXmms ';

@playlist =`xmmsctrl playlist`;

#del first 8
$pos = `xmmsctrl getpos`;
if ($pos < 5) {$pos=6;}

for ($i=$pos-10;$i<=$pos+10;$i++) {

$tmp=substr($playlist[$i-1],4,100);
$tmo=chomp($tmp);
if ($i == $pos)  {$tmp=".: $tmp :.";}
print "+  \"$tmp\"    exec exec xmmsctrl track $i\n";
}
</code>

i know it's ugly, but hey, it works (kind of)
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to