Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MPRIS Reference

This page documents the variables and CLI commands exposed by oatbar-mpris.

Variables

The oatbar-mpris daemon continuously outputs the state of the active MPRIS media player. All variables are available under the mpris.mpris.* namespace (assuming your command is named mpris).

VariableDescription
mpris.mpris.full_textA formatted string combining artist and title with a music: prefix (e.g. music: Artist - Title).
mpris.mpris.trackIdentical to the formatting of full_text but without the music: prefix.
mpris.mpris.titleThe track title.
mpris.mpris.artistThe track artist.
mpris.mpris.albumThe album name.
mpris.mpris.playback_statusCurrent playback state: Playing, Paused, or Stopped.
mpris.mpris.playerShort name of the active player (e.g. spotify, vlc).
mpris.mpris.volumePlayer volume level (0-100).
mpris.mpris.lengthTrack duration in seconds.
mpris.mpris.length_strTrack duration formatted as MM:SS or HH:MM:SS.
mpris.mpris.positionCurrent playback position in seconds.
mpris.mpris.position_strCurrent playback position formatted as MM:SS or HH:MM:SS.
mpris.mpris.position_tsThe Unix timestamp (in seconds) of the last position sample. Useful for manual interpolation.
mpris.mpris.rateCurrent playback rate (multiplier, typically 1.0).

CLI Commands

The oatbar-mpris binary also acts as a CLI client to control the active media player.

oatbar-mpris [COMMAND]

Output Mode

Running without any command acts as a long-running daemon that streams i3bar JSON to standard output. It is intended to be run by oatbar as an external block configuration command.

Media Controls

These commands interact with the currently active media player:

  • play — Start or resume playback.
  • pause — Pause playback.
  • play-pause — Toggle between play and pause.
  • next — Skip to the next track.
  • previous — Go to the previous track.
  • stop — Stop playback entirely.
  • seek <PCT> — Seek to a specific percentage of the track (0-100).

Example:

oatbar-mpris seek 50

(Seeks strictly to the midpoint of the current track)