An open API service indexing awesome lists of open source software.

https://github.com/valodim/mpdzen

mpd status notification using dzen2, including a tiny but functional cover art fetcher
https://github.com/valodim/mpdzen

Last synced: 3 months ago
JSON representation

mpd status notification using dzen2, including a tiny but functional cover art fetcher

Awesome Lists containing this project

README

          

mpdzen
======

This is just me flexing my zsh muscles a little, creating some things
marginally useful in the process.

./mpc_parse
-----------

Simple parser for mpc status. Not useful on its own, this can be sourced
from other scripts to get that data.

./mpdzen
---------

This script fetches data using mpc_parse and displays it in a nice dialogue
using dzen2. Note this requires a development version of dzen2, the one from
debian package in particular will not suffice!
The dialogue will also include a cover art image, if there is one in xpm format
in ./covers/$ARTIST/$ALBUM.xpm or ~/.cache/covers/$ARTIST/$ALBUM.xmp

Have a screenshot:

![Screenshot](https://github.com/Valodim/mpdzen/raw/master/shot.png)

./mpdzen_loop
-------------

Very small utility that listens for mpd events using mpc idleloop, and when
a player event happens, calls mpdzen. Basically, this will show the mpdzen
notification everytime a new song is played.

./cover_fetcher ARTIST ALBUM
----------------------------

This script will attempt to download a cover for $ALBUM by $ARTIST using curl,
and convert it to a 64x64 xpm image using ImageMagick's convert. For my nicely
sorted collection of data in its ARTIST/ALBUM/TITLES hierarchy, this worked
very well (zsh, obviously):

p=/path/to/mp3/
for i in ${~p}/*/*(/); do
i=${i#$p};
./cover_fetcher ${i%/*} ${i#*/};
echo;
done

./dzenlines
-----------

This script wraps dzen2, and will adjust the __-y__ parameter for subsequent
calls depending on the __-p__, __-y__ and __-h__ parameters, so that they don't
overlap. For example, if you call three times `dzenlines -y 50 -h 30 -p 3`, it
will move the __-y__ further down by *34* pixels, which is the __-h__ parameter
plus a bit of padding. Once the timeout given by __-p__ is reached, the offset
is reset to zero.

Be wary of non key-value arguments for dzen (ie, __-m__ and __-u__), they may
confuse the script. Just put them on the tail end of the arguments and it
should be fine.

The script keeps track of state for each pair of __-x__,__-y__ parameters, and
will move up or down the screen depending on the sign of __-y__.

patches
-------

This is a quilt patches dir that can be applied to dzen2, to allow escaping of
closing parantheses for ^i() syntax. This is necessary if album names contain
any ), which will blow it up otherwise.