Skip to content

Music

Displays currently playing song from your music player. This module supports both MPRIS players and MPD servers. Clicking on the widget opens a popout displaying info about the current song, album art and playback controls.

in MPRIS mode, the widget will listen to all players and automatically detect/display the active one.

Screenshot showing MPD widget with track playing with popout open

Configuration

Type: music

TypeDefaultDescription
player_type'mpris' or 'mpd'mprisWhether to connect to MPRIS players or an MPD server.
formatstring{title} / {artist}Format string for the widget. More info below.
truncate'start' or 'middle' or 'end' or off or MapoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating. Use the long-hand Map version if specifying a length.
truncate.mode'start' or 'middle' or 'end' or offoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating.
truncate.lengthintegernullThe fixed width (in chars) of the widget. Leave blank to let GTK automatically handle.
truncate.max_lengthintegernullThe maximum number of characters before truncating. Leave blank to let GTK automatically handle.
truncate_popup_artist'start' or 'middle' or 'end' or off or MapoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating. Use the long-hand Map version if specifying a length.
truncate_popup_artist.mode'start' or 'middle' or 'end' or offoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating.
truncate_popup_artist.lengthintegernullThe fixed width (in chars) of the widget. Leave blank to let GTK automatically handle.
truncate_popup_artist.max_lengthintegernullThe maximum number of characters before truncating. Leave blank to let GTK automatically handle.
truncate_popup_album'start' or 'middle' or 'end' or off or MapoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating. Use the long-hand Map version if specifying a length.
truncate_popup_album.mode'start' or 'middle' or 'end' or offoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating.
truncate_popup_album.lengthintegernullThe fixed width (in chars) of the widget. Leave blank to let GTK automatically handle.
truncate_popup_album.max_lengthintegernullThe maximum number of characters before truncating. Leave blank to let GTK automatically handle.
truncate_popup_title'start' or 'middle' or 'end' or off or MapoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating. Use the long-hand Map version if specifying a length.
truncate_popup_title.mode'start' or 'middle' or 'end' or offoffThe location of the ellipses and where to truncate text from. Leave null to avoid truncating.
truncate_popup_title.lengthintegernullThe fixed width (in chars) of the widget. Leave blank to let GTK automatically handle.
truncate_popup_title.max_lengthintegernullThe maximum number of characters before truncating. Leave blank to let GTK automatically handle.
icons.playstring or imageIcon to show when playing.
icons.pausestring or imageIcon to show when paused.
icons.prevstring or image󰒮Icon to show on previous button.
icons.nextstring or image󰒭Icon to show on next button.
icons.volumestring or image󰕾Icon to show under popup volume slider.
icons.trackstring or image󰎈Icon to show next to track title.
icons.albumstring or image󰀥Icon to show next to album name.
icons.artiststring or image󰠃Icon to show next to artist name.
show_status_iconbooleantrueWhether to show the play/pause icon on the widget.
icon_sizeinteger32Size to render icon at (image icons only).
cover_image_sizeinteger128Size to render album art image at inside popup.
hoststringlocalhost:6600[MPD Only] TCP or Unix socket for the MPD server.
music_dirstring$HOME/Music[MPD Only] Path to MPD server’s music directory on disc. Required for album art.
JSON
{
"start": [
{
"type": "music",
"player_type": "mpd",
"format": "{title} / {artist}",
"truncate": "end",
"icons": {
"play": "",
"pause": ""
},
"music_dir": "/home/jake/Music"
}
]
}
TOML
[[start]]
type = "music"
player_type = "mpd"
format = "{title} / {artist}"
music_dir = "/home/jake/Music"
truncate = "end"
[start.icons]
play = ""
pause = ""
YAML
start:
- type: "music"
player_type: "mpd"
format: "{title} / {artist}"
truncate: "end"
icons:
play: ""
pause: ""
music_dir: "/home/jake/Music"
Corn
{
start = [
{
type = "music"
player_type = "mpd"
format = "{title} / {artist}"
truncate = "end"
icons.play = ""
icons.pause = ""
music_dir = "/home/jake/Music"
}
]
}

Formatting Tokens

The following tokens can be used in the format config option, and will be replaced with values from the currently playing track:

TokenDescription
{title}Title
{album}Album name
{artist}Artist name
{date}Release date
{track}Track number
{disc}Disc number
{genre}Genre

Styling

SelectorDescription
.musicTray widget button
.music .contentsTray widget button contents box
.music .contents .iconTray widget button icon (any type)
.music .contents .text-iconTray widget button icon (textual only)
.music .contents .imageTray widget button icon (image only)
.popup-musicPopup box
.popup-music .album-artAlbum art image inside popup box
.popup-music .titleTrack title container inside popup box
.popup-music .title .icon-boxTrack title icon container inside popup box
.popup-music .title .icon-box .iconTrack title icon inside its container (any type)
.popup-music .title .icon-box .text-iconTrack title icon inside its container (textual only)
.popup-music .title .icon-box .imageTrack title icon inside its container (image only)
.popup-music .title .labelTrack title label inside popup box
.popup-music .albumTrack album container inside popup box
.popup-music .album .icon-boxTrack album icon container inside popup box
.popup-music .album .icon-box .iconTrack album icon inside its container (any type)
.popup-music .album .icon-box .text-iconTrack album icon inside its container (textual only)
.popup-music .album .icon-box .imageTrack album icon inside its container (image only)
.popup-music .album .labelTrack album label inside popup box
.popup-music .artistTrack artist container inside popup box
.popup-music .artist .icon-boxTrack artist icon container inside popup box
.popup-music .artist .icon-box .iconTrack artist icon inside its container (any type)
.popup-music .artist .icon-box .text-iconTrack artist icon inside its container (textual only)
.popup-music .artist .icon-box .imageTrack artist icon inside its container (image only)
.popup-music .artist .labelTrack artist label inside popup box
.popup-music .controlsControls container inside popup box
.popup-music .controls .btn-prevPrevious button inside popup box
.popup-music .controls .btn-playPlay button inside popup box
.popup-music .controls .btn-pausePause button inside popup box
.popup-music .controls .btn-nextNext button inside popup box
.popup-music .volumeVolume container inside popup box
.popup-music .volume .sliderSlider inside volume container
.popup-music .volume .iconIcon inside volume container
.popup-music .progressProgress (seek) bar container
.popup-music .progress .sliderSlider inside progress container
.popup-music .progress .labelDuration label inside progress container

For more information on styling, please see the styling guide.