Table of Contents
I. empxformrc
empxformrc -- Configuration file for empxform

I. empxformrc

Table of Contents
empxformrc -- Configuration file for empxform



empxformrc -- Configuration file for empxform


The configuration files ~/.empxformrc or /usr/share/empxform/empxformrc, /usr/local/share/empxform/empxformrc are read when the application starts. They contain some general configuration information and a list of default formats in the <options> section followed by a list of format specifiers. Each <format> section describes a set of actions to take based on the contents of the emp file.


The DTD describing the configuration file format is available from sourceforge.

Substitution Variables

The following variables are may be used anywhere text is accepted in the config file.

Session Related

  • %P - provider name

  • %T - package title (The album name on emusic)

  • %A - the track artist (or 'Various Artists' if more than 1 was found)

Track related

  • %t - title

  • %a - artist

  • %n - track number

  • %f - the remote file name

  • %d - id of the current track

  • %g - genre

  • %F - format

  • %q - quality

  • %c - album art (the url of the cover image)

  • %U - the complete url of the current track

  • %D - the duration of the track in seconds

  • %C - the number of audio channels


  • %O - generated output file name (created by the empxform <filename> rule)

  • %E - the full path to the emp file

  • %W - the empXfom working directory (from the config options)

  • %% - a literal %

Variable Modifiers

The following variable modifiers can be used to make variables more shell friendly. Each of the following characters are considered as special: "\'<>[]()\/~!#$&|; and the space character.

  • %'X - remove quotes & / chars from %X

  • %\X - escape all special shell chars in %X

  • %_X - remove all special shell chars from X & change spaces to underscores

  • %-X - remove all special shell chars from X

  • %!X - convert all /'s to - in X


The options section specifies the working directory for the program (the application will change to this directory before doing any work) followed by a list of default formats to use if none are sepcified on the command line. The following example shows a valid options section that downloads albums & creates playlists by default.

  <options working-dir="~/My Music">
      <default-format name="playlist-m3u"/>
      <default-format name="download-wget"/>


Each format defines a template to use when processing the rmp file. The template sepcifies the name of any other formats to run first, the name (if any) of the output file, the contents of the file and an optional program to run when processing is complete. Each <format> section contains one or more of the following tags:

  • <desc>- This is the only compulsory tag, it should contain a brief description of the format.

  • <run-format name="XXX"> - The name of a format to run before processing this format. There may be 0 or more other formats.

  • <filename> - The name of the output file to generate releative to the working directory. If this tag is omitted output will be written to standard out.

  • <begin> - Text to place at the begining of the ouput file.

  • <track> - Text to generate for each track in the emp file, this would normall contain 1 or more substitution variables based on the track information.

  • <end> - Text to place at the end of the output file.

  • <exec> - The shell command line to run after processing has been completed.


The shell pattern ~ is expanded to the current users home directory but ~useranme is not understood.


Cameron Dorrat ()


To play a sound when a download has finished

<format name="play-sound">
    <desc>Play Some Music when finished</desc>
    <exec>cat /music/ > /dev/dsp</exec>

Add <default-format name="play-sound"/> as the last entry in the options section of the config file.

A complete config file which generates m3u playlists by default

  <options working-dir="~/My Music">
 <default-format name="playlist-m3u"/>

  <format name="playlist-m3u">
 <desc>Create a m3u format playlist</desc>

 <!-- assume we downloaded to 'Artist_Name/Album_Name' -->


 <!-- add extended info for the duration, artist & track name -->
 <track>#EXTINF:%D,%a: %t</track>  

 <!-- assume we named the tracks like '01 - some_track.mp3' -->
 <track>%n - %f</track>

See Also