Skinning XMMS with BuildImage and Skencil
Using the Python package“BuildImage” version 1.2 and its customized code for creating “skins” for the popular automatic music player
Download the whole article as PDF
- 2005-08-09
- Server side | Intermediate
-
Write a full post in response to this!
XMMS is a very nice program for playing music, but the default skin that comes with it is, well, “functional”. Fortunately, though, the program uses the same skin files as WinAMP 2.0 (several other programs use these skins as well, which I’ll call simply “AMP2 skins”). A “skin” is just a collection of images used to create the appearance of an application such as a music player (Figure 1).
In this case, the skin is simply a ZIP file with a funny extension .wsz (which presumably stands for “WinAMP Skin Zipfile”), containing a number of BMP format images with some very odd contents. There’s not a lot of rhyme or reason to their layout, but the icons used by the program are extracted from them at runtime. Furthermore, since BMP doesn’t support transparency, some very careful copy-and-paste work has to be done to fake transparency, as many AMP2 skins do. The results can be amazing, but unbelievably tedious to create manually.
You can wade through this technical detail to create a skin using raster tools, or you can accept the limitations of using a commercial application to do the work for you, or—now—you can use BuildImage to generate a skin more sensibly from a drawing in Skencil.
XMMS is a very nice program for playing music, but the default skin that comes with it is, well, “functional”
What you need
Naturally, you’ll have to make sure you have the software first. Most of the software is available in popular Linux distributions, so you can probably install using mostly binary packages. You will have to install BuildImage from the source, but this is easy, as it’s a pure-python package. You’ll need:
- Skencil (0.6.15): May still be called “Sketch” in your distribution (e.g. Debian, Red Hat).
- Python (2.2): You needed this to install Skencil, and BuildImage relies on it too.
- Python Imaging Library (1.1.3): You also needed this to install Skencil, so you probably already have it.
- Gimp (1.2): Strictly speaking, you can skip this, but it’s useful for composing background images.
- BuildImage (1.2-beta): The AMP2 features are brand-new in this version, so don’t try to use an older one. The examples used in this article are included in the distribution.
I’ll leave you to the installation instructions for each package, but Skencil and BuildImage both use distutils, so installation is along the lines of:
tar zxf Package-version.tgz cd Package-version python ./setup.py build # su to root python ./setup.py install
Once the software is installed, you’ll need to create a working directory for your skin project. The easiest way to do this is just to recursively copy from the example/AMP2 directory in the BuildImage distribution, which contains several examples, including the ones in this article, as well as the “default” skin template for BuildImage.
This is what you get:
samwise:~/tutor> tree . |-- bitmap | `-- textdef.bmp |-- scripts | |-- __init__.py | |-- animated.py | |-- default.py | `-- vanity.py |-- setup.py `-- sketch |-- amp2.sk |-- animated.sk |-- myth_bkg.jpg |-- myth_ws.jpg |-- vanity.sk `-- vanity2.sk
The file amp2.sk is the template for creating a skin drawing in Skencil. You’ll rename it when you create a new drawing (such as with the other example files you see here). The setup.py file runs the scripts package, which contains scripts to build each of the examples. If you open one of these scripts, you can see that the AMP2 support in BuildImage consists of two functions amp2_img() which is simply a BuildImage script tailored to the provided amp2.sk template, and amp2_skin() which compiles the skin archive from those images.
The directory “bitmap” contains an original bitmap of the default XMMS font, which we will be using (you can do this part in Skencil but it’s probably a waste of time).
At this point you can make the default skin, and that’s probably a good way to make sure you have everything configured. You may have to set an environment variable to make sure that your Python can find Skencil. For example, on my system, I need to type:
setenv PYTHONPATH /usr/lib/sketch-0.6.15
Now, simply type the following to build the default skins (from the example directory, or your copy of it):
python ./setup.py
This will run the scripts/__init__.py file that calls BuildImage to create the skins. Like “make”, BuildImage is very noisy, printing lots of messages to the screen. This is meant to make it easier to trace a problem when one occurs. You won’t really have to worry about missing-font warnings—the important text in the drawings has been converted to curves to avoid portability problems. Only the text labeling in the template (which doesn’t print) should be affected by font problems, and you’ll still be able to read them, even if the font is not quite right. Also like compiling a package with “make”, you can expect the build to put a fairly heavy load on your system.
At the end, you’ll find a series of named build directories—one for each drawing file. These contain all of the image components that were needed to make the skins as well as the actual skin files ( *.wsz ). You can now install the skin files into your ~/.xmms/Skins/ directory to make them available for you only, or switch to root and install them into the XMMS installation on your system (probably /usr/share/xmms/Skins ), to make them available for all users.
Write a full post in response to this!
Similar articles
Do you like this post?
Vote for it!
Copyright information
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html.
Biography
Terry Hancock: Terry Hancock is co-owner and technical officer of Anansi Spaceworks, dedicated to the application of free software methods to the development of space.
- Login or register to post comments
- 8883 reads
- Printer friendly version (unavailable!)




Best voted contents
-
Google App Engine: Is it evil?
Terry Hancock, 2008-04-24 -
The Bizarre Cathedral - 3
Ryan Cartwright, 2008-05-05 -
Free Software Magazine Awards 2008
Tony Mobily, 2008-04-22 -
The Bizarre Cathedral - 2
Ryan Cartwright, 2008-04-27
Similar entries
Buzz authors
All news
From the FSM staff...
- The Top 10 Everything (Dave). The good, the bad and the ugly.
- Free Software news (Dave & Bridget). A site about short stories and writing.
- Book Reviews: Illiterarty (Bridget). Book reviews, blogs, and short stories.
Hot topics - last 60 days
-
Installing an all-in-one printer device in Debian
Ryan Cartwright, 2008-05-05 -
What is the free software community?
Tony Mobily, 2008-03-29 -
Things you miss with GNU/Linux
Ryan Cartwright, 2008-05-01 -
Drigg (the pligg alternative) vs. Pligg: why should people switch?
Tony Mobily, 2008-04-13 -
Why Microsoft should not lose (and free software will still win)
Ryan Cartwright, 2008-04-21

Dedicated server