MPD Playlist editor

I’ve written (well hacked together would be more appropriate I guess) a FvmScript playlist editor for the Music Player Daemon (mpd), much of this I did for the sake of the excercise, but it may very well be of use to some of you so I provide it here.

You can get the necessary files here, it unpacks into a directory called FvwmMpd.

You need the following things to be able to use these scripts:[list][]mpc[/:m]
[]python[/:m][/list:u]There are a couple of things you need to do to before you can start using this, firstly you’ll need to edit the paths in the FvwmApplet-* scripts to reflect the location you put the scripts in, the other files should be alright in this respect (if you place these scripts in a scripts subdirectory in you $FVWM_USERDIR you can save yourself this hassle, this means the actual scripts end up in $FVWM_USERDIR/scripts/FvwmMpd/).

You can then launch the playlist editor by putting something like this in your menu:

+ "MPD Playlist Editor" FvwmScript <path to scriptfiles>/FvwmApplet-MpdPlEd

NOTE: this is only the playlist editor, use Hun’s FvwmMpd client to create a completely FvwmScript based mpd client.

If you have any suggestions or find any bugs, please do post them here :slight_smile:

[EDIT]Updated the link to point to the new release.
[EDIT]New release, moved Hun’s crop option under that name and added the mpd clear command.

Nice Work!

I suggest adding a Button for mpc crop' or mpc clear’ for clearing the Playlist (already did this here, just can’t upload to your site :wink:)

For the sake of it: Screenshot

To show the themability through the use of colorsets: (not all are supposed to look good)


This is exactly why I love FVWM so much! The community and talent behind/support of the project.

theBlackDragon, I could kiss you (except my husband would get jealous :slight_smile: )! I have been trying to figure out a way of accomplishing this very same thing. I have been slapping different parts of gui’s together to create just a thing. Unfortunately for me, I have no programming ability so I have not done anything! For me this is the one thing that was missing from mpd…a simple playlist editor with out all the extra stuff.

Thank you! I can’t wait to try

Additional NOTE for all of you where it doesn’t work (had some in IRC yesterday):

It may be that on your System, the program /bin/env may be missing. In that case, exchange the

#!/bin/env bash

with #!/bin/bash
btw. #!/usr/bin/python for the pythonscripts

Thank you

PS: Chickpea: You should have a look at FvwmScript, don’t know an easier way for GUI-Programming.
and behind both of those apps (ok, this one is a bit bigger than mine), nearly only shellscripts are working…

PPS: Since theBlackDragon seems to be afk right now, here is a patch for adding a `Clear’ Option to the Options-Menu: ClickMe

Just to let you know that I’m still working on this, I will hopefully be incorporating Hun’s patch tomorrow, I had planned on doing it today but I didn’t plan the fan on my graphics card to go defunct, neither did I plan my favourite editor (emacs) and shell (zsh) to go totally crazy on me on my laptop, been trying to fix that all day now…

I should have a new cooler tomorrow and then I’ll update the tarball and the opening post :slight_smile:

I’ve released a 0.1.1 version, there’s only one minor addition and that’s the inclusion of Hun’s patch from a few posts back :slight_smile:

Can someone explain to me what this means?

Set $MainColorset=(GetScriptArgument 1)

#load the current playlist
ChangeTitle 1 (GetOutput { $FVWM_USERDIR/scripts/FvwmMpd/| tr ‘\n’ ‘|’ } 1 -1 )

If $MainColorset <> {} Then
ChangeColorset 0 $MainColorset
ChangeColorset 1 $MainColorset
ChangeColorset 2 $MainColorset
ChangeColorset 3 $MainColorset
ChangeColorset 4 $MainColorset
ChangeColorset 5 $MainColorset
ChangeColorset 6 $MainColorset
ChangeColorset 100 $MainColorset
ChangeColorset 101 $MainColorset
ChangeColorset 102 $MainColorset

I am mostly concerned about the MainColorset aspect. Is this an Environment variable that should be set in the fvwm config?



It just sets the colorsets for the FvwmScript widgets as there’s no (working) way to dynamically set a DefaultColorset, the Colorset number should just be specified as an argument to when calling the script, like this:

FvwmScript $[FVWM_USERDIR]/scripts/FvwmMpd/FvwmApplet-MpdPlEd 3

So it’s no environment variable but an argument when running the script, if there’s no argument specified then the default colors are used :slight_smile:

That is true…I am not that creative yet. I have big ideas but don’t know how to recreate them myself. However, taking your suggestion and taking an idea I had, i used one of the scripts from theBlackDragon’s FvwmMpd playlist editor for Torsmo and this is what I got.

A little background about why i do this. None of the client’s for mpd is “perfect” for me. I now control MPD thru my keyboard with an edited .Xmodmap file so it pauses, play, mutes, stops…what was missing is a playlist editor. I had been using pympc. I like it but it is not perfect either. I usually open two of those so I can view the library and the playlist at the same time.

I started experimenting with torsmo with other peoples configs and i liked the display for mpd “now playing” displays people used. But I wanted something a little more than that. Something that would display the playlist and “mark” the currently playing song on the root window. Hard to do with a *term without it getting overly complicated.

Now all I need is a way to get mpd to remove already played songs from the playlist. :0

Edit: Changed the image size

I just started using mpd and i find this really light-weight and therefore nice, thanks!
Although this would reaally call for a hack to the fvwm source to enable which mouseclick gives what command in FvwmScript :/… It’d be much nicer being able to scroll.

I’ve noticed some bugs reading filenames… sometimes they miss a “0” or something like “01 -” is missing etc…

Otherwise, great work!

Hmm, haven’t noticed anything like that here, only very queer characters could make an impact now like a doublcequote or such. If you could provide some more information I’ll try to fix it :slight_smile:

Ok, so let’s start with MpdAddSong
First time i fire it up, it goes to the directry with my song
here’s the ls output
And when it’s open it will display everything there as direcotires (those three songs in the end doesn’t appear on the right side)

If i goto a direcotry and then go one UP (still in your applet) it will display those three songs in the right bar but all are missing their first character in the name…

PlEd doesn’t display my whole playlist,
It stops at #697 in a song named “Utaipito Hane - Mitaitoru”, it only displays “Utaipito Han”

The second is a known problem and due to the limits of (GetOutput), the exact amount of songs depends on the length of their names, I should rewrite everything as an Fvwm module to be able to fix this issue…

The first one I’ll have to look into as I don’t have any songs in the root of my mpd directory, I also have never had characters get cut off, I’ll see if I can reproduce this :slight_smile:

I found one interessant thing… about the problem with #!/bin/env…

On my box(a debian), env is placed in /usr/bin

Hmm, why can’t everybody just put it in the same location… Here (Gentoo) it’s placed in /bin/env … This is pretty annoying as it limits the portability of something designed to make scripts portable… :frowning:

yeah I found that quite stupid… erf…

That does indeed break LSB standards. Are you sure /bin/env is not a symlink to /usr/bin/env ? Either way, the latter location is the “correct” one. File a bug against the ebuild, if you know who to poke about it. :slight_smile:

– Thomas Adam

ls -lha /usr/bin/ |grep env

lrwxrwxrwx 1 root root 8 Apr 25 03:42 env -> /bin/env
Would seem it’s the other way around.

Gah, I never thought they would have used a construct like that, now I’ve changed it to /usr/bin/env as that seems to be the most common situation.

A new version has been released, see here, any following discussion about FvwmMpd should happen in that thread, so I’m locking this one :slight_smile: