Re: FVWM: Fvwm Playlist Menu

From: .newmind <new_mind_at_web.de>
Date: Fri, 07 May 2004 21:30:31 +0200

On Fri, 7 May 2004 18:55:44 +0200, Antoine Marmignon
<antoine.marmignon_at_club-internet.fr> 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
';

_at_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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Fri May 07 2004 - 14:33:26 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:56 BST