Qball's Weblog

MPD Hack of the week

Tags General  gmpc  mpd 

Well now that mpd 0.13.0 is released. Time to announce my mpd hack of the week.

It doesn’t actually hack mpd, or need recompile, you can run it separately.

What does it do:

  1. Watch mpd’s music directory using inotify.

  2. When an update is made (create/delete/modify) track this.

  3. 25 seconds after the last update, tell mpd to update the directory  that have all updates in commen. (so if update in /Sorted/L-Z/L/ and updates in /Sorted/L-Z/Z/ it will update /Sorted/L-Z/).

  4. if mpd was allready updating, try again in 25 seconds.

As I said it’s a hack, so it most likely make your dog cranky and your coffee sour.

It requires: libmpd,  libglib-2.0 (for the main loop) and inotify support.

Download inot.tar.gz

extract, and run make. (there is a i386 binary inside.)

edit config.cfg

run it ./inot

and it _should_ work.

Qball

p.s. possible new gmpc icon, let me know what you think: