Skip to content
Rémi NICOLE edited this page Apr 18, 2019 · 18 revisions

The mpd module displays information about a running "Music Player Daemon" instance.

Config

Addressed by mpd

option typeof default description
server string The network address or Unix socket path of the MPD server. If empty, connect to the default host.
port integer The port MPD listens to. If empty, use the default port.
format string "{album} - {artist} - {title}" Information displayed when a song is playing or paused
format-stopped string "stopped" Information displayed when the player is stopped.
format-disconnected string "disconnected" Information displayed when the MPD server can't be reached.
tooltip bool true Option to disable tooltip on hover.
tooltip-format string "MPD (connected)" Tooltip information displayed when connected to MPD.
tooltip-format-disconnected string "MPD (disconnected)" Tooltip information displayed when the MPD server can't be reached.
state-icons object {} Icon to show depending on the play/pause state of the player ({ "playing": "...", "paused": "..." })
consume-icons object {} Icon to show depending on the "consume" option ({ "on": "...", "off": "..." })
random-icons object {} Icon to show depending on the "random" option ({ "on": "...", "off": "..." })
repeat-icons object {} Icon to show depending on the "repeat" option ({ "on": "...", "off": "..." })
single-icons object {} Icon to show depending on the "single" option ({ "on": "...", "off": "..." })

Format replacements

When playing/paused:

string replacement
{artist} The artist of the current song
{albumArtist} The artist of the current album
{album} The album of the current song
{title} The title of the current song
{date} The date of the current song
{elapsedTime} The current position of the current song. To format as a date/time (see example configuration)
{totalTime} The length of the current song. To format as a date/time (see example configuration)
{stateIcon} The icon corresponding the playing or paused status of the player (see state-icons option)
{consumeIcon} The icon corresponding the "consume" option (see consume-icons option)
{randomIcon} The icon corresponding the "random" option (see random-icons option)
{repeatIcon} The icon corresponding the "repeat" option (see repeat-icons option)
{singleIcon} The icon corresponding the "single" option (see single-icons option)

When stopped / disconnected:

string replacement
{consumeIcon} The icon corresponding the "consume" option (see consume-icons option)
{randomIcon} The icon corresponding the "random" option (see random-icons option)
{repeatIcon} The icon corresponding the "repeat" option (see repeat-icons option)
{singleIcon} The icon corresponding the "single" option (see single-icons option)

Example

"mpd": {
	"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ",
	"format-disconnected": "Disconnected ",
	"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
	"interval": 2,
	"consume-icons": {
		"on": " " // Icon shows only when "consume" is on
	},
	"random-icons": {
		"off": "<span color=\"#f53c3c\"></span> ", // Icon grayed out when "random" is off
		"on": " "
	},
	"repeat-icons": {
		"on": " "
	},
	"single-icons": {
		"on": "1 "
	},
	"state-icons": {
		"paused": "",
		"playing": ""
	},
	"tooltip-format": "MPD (connected)",
	"tooltip-format-disconnected": "MPD (disconnected)"
}

Style

  • #mpd
  • #mpd.disconnected
  • #mpd.stopped
  • #mpd.playing
  • #mpd.paused
Clone this wiki locally