Mariusz Slonina

Contact   Site Login

Xmms2 and Esperanza on my Gentoo box

If you ever encounter problems with installing Xmms2 and Esperanza client on Gentoo box, here is a solution.

Step 1: Download Xmms2 & Esperanza sources:

Xmms2: (http://wiki.xmms2.xmms.se/wiki/Download_XMMS2#Source)
Esperanza: (http://wiki.xmms2.xmms.se/wiki/Client:Esperanza)

I usually install non-portage apps in /usr/local directory. I assume you unpack sources to /usr/local/src dir

Step 2: Compile and install Xmms2

Xmms2 uses waf build system:


cd xmms2-0.5DrLecter
./waf configure
./waf build
./waf install

Step 3: Compile and install Esperanza

Esperanza, IMHO is one of the best Xmms2 clients - however compiling it was my head-ache for long time, because configure script couldn't find xmms2 c++ bindings, which were previous installed of course. Solution for this is rather simple:


export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig


cd esperanza
./configure
make
make install

That's all folks!

xmms2 esperanza

And covers? (proof of concept)

I needed a fast, working solution for adding covers to music files. As you know (or read in xmms2 manual) you can do that for one file by simple command:

xmms2 mlib addcover cover.jpg fileID

However, if you want to add covers by hand to i.e. 10000 mp3 you have... so I wrote another simple bash script. Warning! There are no security functions etc. nor user input check -- I needed to write something maximum simple and write it very fast. I share with you with my code -- feel free and enjoy in modifing it!

My proof of concept

#!/bin/bash
QUERY=$1
COVER=$2
echo "Query: ${QUERY}"
ID=$(xmms2 mlib search ${QUERY} | grep \| | awk '{print $1}' | sed s/|/' '/g | tr -d '\n' | sed s/Id/' '/g)
arrayID=( $ID )
echo "ID list: $ID"
for i in ${arrayID[@]}; do
echo "Setting cover file ${COVER} for ID $i"
xmms2 mlib addcover ${COVER} $i
done
echo "Number of processed files: ${#arrayID[@]}"

How it works?
type in your favourite terminal:

xmms2-cover MLIBQUERY COVERNAME

where MLIBQUERY is i.e.

album:3 artist:Grammatik

Example query:

xmms2-cover "album:3 artist:Grammatik" 3.jpg

Output:

Query: album:3 artist:Grammatik
ID list: 03624 03625 03626 03627 03628 03629 03630 03631 03632 03633 03634 03635
Setting cover file 3.jpg for ID 03624
Setting cover file 3.jpg for ID 03625
Setting cover file 3.jpg for ID 03626
Setting cover file 3.jpg for ID 03627
Setting cover file 3.jpg for ID 03628
Setting cover file 3.jpg for ID 03629
Setting cover file 3.jpg for ID 03630
Setting cover file 3.jpg for ID 03631
Setting cover file 3.jpg for ID 03632
Setting cover file 3.jpg for ID 03633
Setting cover file 3.jpg for ID 03634
Setting cover file 3.jpg for ID 03635
Number of processed files: 12

Known (Xmms2) bugs:
* if you have "(" in your ALBUMNAME, Xmms2 will return no results of query (as of DrLecter version). Workaround -- put \(

No comments

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

GoldenLine

See my photos

flickr  picasa