Connection

By default mpdcron will get the host name and port for mpd from MPD_HOST and MPD_PORT environment variables. MPD_PASSWORD environment variable can be set to make mpdcron connect to a password-protected mpd. If these environment variables aren’t set, mpdcron connects to localhost on port 6600.

Key File

At startup mpdcron reads its configuration from the file MPDCRON_DIR/mpdcron.conf where MPDCRON_DIR is ~/.mpdcron by default. Configuration file is in standard .ini format.

    # mpdcron configuration file
    [main]
    # Path to the PID file, by default the PID file is MPDCRON_DIR/mpdcron.pid
    pidfile = /path/to/mpdcron.pid
    # Wait this many seconds after sending signal to kill the daemon.
    # Default is 3 seconds.
    killwait = 3
    # Logging level, default is 0
    # 0: Warnings and errors only
    # 1: Info and below
    # 2: Debug and below
    loglevel = 0
    [mpd]
    # Semicolon delimited list of events to wait for.
    # By default mpdcron waits for all events.
    # Valid events are:
    # database: Song database has been updated.
    # stored_playlist: A stored playlist has been modified, created,
    #   deleted or renamed.
    # playlist: The queue has been modified.
    # player: The player state has been changed: play, stop, pause, seek, ...
    # mixer: The volume has been modified.
    # output: An audio output device has been enabled or disabled.
    # options: Options have changed: crossfade, random, repeat, ...
    # update: A database update has started or finished.
    events = player;mixer
    # Interval in seconds to reconnect to mpd after an error or disconnect.
    reconnect = 5
    # Timeout in milliseconds for mpd timeout, 0 for default timeout of
    # libmpdclient.
    timeout = 0