Home | Onion mirror | Git repo | Git onion | Site map | RSS

Using Acme as a frontend for mpd

When it comes to music, I’m a simple man. I usually listen to whole albums, and I have all of my directories structured as Artist/Album. For a long while I manually navigated to the directory of the album I wanted and would play it with sox from Acme, but that became tedious after a while, and I couldn’t pause sox without opening Acme, so I decided to make a script to make my listening experience more pleasent.

Originally I used Audacious as my backend, mostly because it’s fairly lightweight and can interface directly with my directory structure. It has library features, but it’s really just a glorified playlist manager.

I had tried a couple of times to adapt my scripts to use mpd. The problem was that they were really hacky, and since mpd had its own library, it would take some effort to port them from using Audacious. Eventually though, I got tired of accidentally opening Audacious’ graphical frontend, and got to work adapting my scripts.

One of the first things I knew I would have to change a lot was my directory selector script. It was an ugly mess of sed calls and at one point had multiple flags that were only used by certain other scripts. Now it’s a very readable script making use of ssam, and it runs about 3 times faster.

Adapting the actual player script was trivial, though I was a bit disappointed that there wasn’t an easy way to replace the playing queue in mpc. The only way seems to be clearing the queue, adding the tracks, and then playing. Luckily mpd is very lightweight, so it runs about the same as the Audacious version.

All in all, it was very worth the effort—porting the scripts to mpd. Every script other than Playrc is either shorter, faster, or both. And I never have to worry about Audacious popping up when I log in and try to play something anymore.