Skip to content

Song table format

song_table_format: <song_table_column[]>

An array of Property objects which serve as a template for table of songs thathat are currently in the queue. Each property is a song_table_format.

song_table_column

Describes a single column in the song table. This is a recursive data structure. Whenever a property is not defined the default fallback is used. This fallback can also have a default value.

prop

Property of the song to display in the column. Described in its own section

width

width: "<string>"

Portion of the table width reserved for this column. Can be one of:

  • Exact value: "5" which will result in 5 column width
  • Percentage: "50%" which will result in half the table width

alignment

alignment: Left | Right | Center

Percentage of the table reserved for this column. Sum of these value must be 100.

label

label: None | Some("<string>")

Optional label for the column. Displayed in the table header. Name of the property is used if not provided.

property

(kind: <property_kind>, style: <style>, default: <property>)

kind

What property to display. Described in its own section

style

style: <style>

Style for the property.

default

default: <property>

This is a normal property. It is used as a fallback value when the current property is not defined

property_kind

Kind can be one of three values, static Text, Group or Property which shows one of the metadata tags which are present on the song. There are a few predefined tags that can be used, but a special value is provided to display any arbitraty tag.

Text

kind: Text("<string>")

Will display static text in the table. Mostly useful for default values. For example if a song is missing an album tag, “Unknown Album” can be displayed by specifying Text("Unknown Album") as the default.

Group

A special kind of property that groups multiple properties together. If any of the properties in the group results in a None value, the whole group is considered None and the default value is used.

Consider the following example:

(
kind: Group([
(kind: Property(Artist)),
(kind: Text(" - ")),
(kind: Property(Title)),
]),
default: (kind: Property(Filename))
),

If the artist or the title of the song is missing in its metadata, the whole group will be skipped, including the Text property and the song’s filename will be displayed instead. A group can also contain another group.

Property

kind: Property(File) | Property(Filename) | Property(Title) | Property(Artist) | Property(Album) | Property(Duration) | Property(Other("<tag_name>"))

Will display value of the respective tag from the song. Since tags are not guaranteed to be present, a fallback value can be specified with the default field. Since song files can have arbitrary tags the Other variant can be used to display any tag, even those not explicitly supported by rmpc.

Example

This configuration displays a table with single column. This column displays the Artist of the song if it is present and “Unknown Artist” with red foreground and black background otherwise.

song_table_format: [
(
prop: (kind: Property(Artist),
default: (
kind: Text("Unknown Artist"),
style: (fg: "red", bg: "black"),
default: None
)
),
width_percent: 100,
),
]