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.

Use truncate or marquee options to control how long titles are shown on the bar and popup.

Screenshot showing MPD widget with track playing with popout open

Example

{
start = [
{
type = "music"
player_type = "mpd"
format = "{title} / {artist}"
truncate = "end"
icons.play = ""
icons.pause = ""
music_dir = "/home/jake/Music"
}
]
}

Configuration

Type: music

Size to render the album art image at inside the popup, in pixels.

Type: integer
Default: 128

Format of current song info to display on the bar.

Info on formatting tokens below.

Type: string
Default: {title} / {artist}

[MPD Only] TCP or Unix socket address of the MPD server. For TCP, this should include the port number.

Type: string
Default: localhost:6600

Size to render the icons at, in pixels (image icons only).

Type: integer
Default: 32

Player state icons.

See icons.

Default: None

Object keys

Icon to display nex to album name.

Type: string
Default: 󰀥

Icon to display nex to artist name.

Type: string
Default: 󰠃

Icon to display for next button.

Type: string
Default: 󰒭

Icon to display when paused.

Type: string
Default:

Icon to display when playing.

Type: string
Default:

Icon to display for previous button.

Type: string
Default: 󰒮

Icon to display nex to track title.

Type: string
Default: 󰎈

Icon to display under volume slider.

Type: string
Default: 󰕾

The justification (alignment) of the widget text shown on the bar.

Type: 'left' | 'right' | 'center' | 'fill'
Default: 'left'

See marquee options.

Default: None

Object keys

Whether to enable scrolling on long lines of text. This may not be supported by all modules.

Type: boolean
Default: None

The maximum length of text (roughly, in characters) before it gets truncated and starts scrolling.

Type: integer
Default: None

Controls marquee behavior on hover.

Options:

  • "none": Always scroll (default)
  • "pause": Pause scrolling on hover
  • "play": Only scroll on hover

Default: None

Scrolling is always active, hover has no effect.

Scrolling pauses when the widget is hovered.

Scrolling only occurs when the widget is hovered.

Duration in milliseconds to pause at each loop point.

Type: integer
Default: 5000

Scroll speed in pixels per frame. Higher values scroll faster.

Type: number
Default: 0.5

String displayed between the end and beginning of text as it loops.

Type: string
Default:

See marquee options.

Default: None

Object keys

Whether to enable scrolling on long lines of text. This may not be supported by all modules.

Type: boolean
Default: None

The maximum length of text (roughly, in characters) before it gets truncated and starts scrolling.

Type: integer
Default: None

Controls marquee behavior on hover.

Options:

  • "none": Always scroll (default)
  • "pause": Pause scrolling on hover
  • "play": Only scroll on hover

Default: None

Scrolling is always active, hover has no effect.

Scrolling pauses when the widget is hovered.

Scrolling only occurs when the widget is hovered.

Duration in milliseconds to pause at each loop point.

Type: integer
Default: 5000

Scroll speed in pixels per frame. Higher values scroll faster.

Type: number
Default: 0.5

String displayed between the end and beginning of text as it loops.

Type: string
Default:

See marquee options.

Default: None

Object keys

Whether to enable scrolling on long lines of text. This may not be supported by all modules.

Type: boolean
Default: None

The maximum length of text (roughly, in characters) before it gets truncated and starts scrolling.

Type: integer
Default: None

Controls marquee behavior on hover.

Options:

  • "none": Always scroll (default)
  • "pause": Pause scrolling on hover
  • "play": Only scroll on hover

Default: None

Scrolling is always active, hover has no effect.

Scrolling pauses when the widget is hovered.

Scrolling only occurs when the widget is hovered.

Duration in milliseconds to pause at each loop point.

Type: integer
Default: 5000

Scroll speed in pixels per frame. Higher values scroll faster.

Type: number
Default: 0.5

String displayed between the end and beginning of text as it loops.

Type: string
Default:

See marquee options.

Default: None

Object keys

Whether to enable scrolling on long lines of text. This may not be supported by all modules.

Type: boolean
Default: None

The maximum length of text (roughly, in characters) before it gets truncated and starts scrolling.

Type: integer
Default: None

Controls marquee behavior on hover.

Options:

  • "none": Always scroll (default)
  • "pause": Pause scrolling on hover
  • "play": Only scroll on hover

Default: None

Scrolling is always active, hover has no effect.

Scrolling pauses when the widget is hovered.

Scrolling only occurs when the widget is hovered.

Duration in milliseconds to pause at each loop point.

Type: integer
Default: 5000

Scroll speed in pixels per frame. Higher values scroll faster.

Type: number
Default: 0.5

String displayed between the end and beginning of text as it loops.

Type: string
Default:

[MPD Only] Path to root of the MPD server’s music directory. This is required for displaying album art.

Type: string
Default: $HOME/Music

The orientation to display the widget contents. Setting to vertical will rotate text 90 degrees.

Type: 'horizontal' | 'vertical'
Default: 'horizontal'

Type of player to connect to

Type: 'mpd' | 'mpris'
Default: None

Whether to show the play/pause status icon on the bar.

Type: boolean
Default: true

See truncate options.

Default: None

Do not truncate content.

Setting this option may cause excessively long content to overflow other widgets, shifting them off-screen.

{ truncate = "off" }

Auto mode lets GTK decide when to ellipsize.

To use this mode, set the truncate option to a string declaring the location to truncate text from and place the ellipsis.

{ truncate = "start" }

Length mode defines a fixed point at which to ellipsize.

Generally you will want to set only one of length or max_length, but you can set both if required.

{
truncate.mode = "start"
truncate.length = 50
truncate.max_length = 70
}
Object keys

The fixed width (in characters) of the widget.

The widget will be expanded to this width if it would have otherwise been smaller.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The maximum number of characters to show before truncating.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The location to truncate text from and place the ellipsis.

Type: 'none' | 'start' | 'middle' | 'end'
Default: None

See truncate options.

Default: None

Do not truncate content.

Setting this option may cause excessively long content to overflow other widgets, shifting them off-screen.

{ truncate = "off" }

Auto mode lets GTK decide when to ellipsize.

To use this mode, set the truncate option to a string declaring the location to truncate text from and place the ellipsis.

{ truncate = "start" }

Length mode defines a fixed point at which to ellipsize.

Generally you will want to set only one of length or max_length, but you can set both if required.

{
truncate.mode = "start"
truncate.length = 50
truncate.max_length = 70
}
Object keys

The fixed width (in characters) of the widget.

The widget will be expanded to this width if it would have otherwise been smaller.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The maximum number of characters to show before truncating.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The location to truncate text from and place the ellipsis.

Type: 'none' | 'start' | 'middle' | 'end'
Default: None

See truncate options.

Default: None

Do not truncate content.

Setting this option may cause excessively long content to overflow other widgets, shifting them off-screen.

{ truncate = "off" }

Auto mode lets GTK decide when to ellipsize.

To use this mode, set the truncate option to a string declaring the location to truncate text from and place the ellipsis.

{ truncate = "start" }

Length mode defines a fixed point at which to ellipsize.

Generally you will want to set only one of length or max_length, but you can set both if required.

{
truncate.mode = "start"
truncate.length = 50
truncate.max_length = 70
}
Object keys

The fixed width (in characters) of the widget.

The widget will be expanded to this width if it would have otherwise been smaller.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The maximum number of characters to show before truncating.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The location to truncate text from and place the ellipsis.

Type: 'none' | 'start' | 'middle' | 'end'
Default: None

See truncate options.

Default: None

Do not truncate content.

Setting this option may cause excessively long content to overflow other widgets, shifting them off-screen.

{ truncate = "off" }

Auto mode lets GTK decide when to ellipsize.

To use this mode, set the truncate option to a string declaring the location to truncate text from and place the ellipsis.

{ truncate = "start" }

Length mode defines a fixed point at which to ellipsize.

Generally you will want to set only one of length or max_length, but you can set both if required.

{
truncate.mode = "start"
truncate.length = 50
truncate.max_length = 70
}
Object keys

The fixed width (in characters) of the widget.

The widget will be expanded to this width if it would have otherwise been smaller.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The maximum number of characters to show before truncating.

Leave unset to let GTK automatically handle.

Type: integer
Default: None

The location to truncate text from and place the ellipsis.

Type: 'none' | 'start' | 'middle' | 'end'
Default: None

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.