Sidecar

The playbar Rust binary is a thin MPRIS-to-NDJSON bridge. It can be used standalone, independent of the VSCode extension.

CLI

playbar --once                       # one JSON snapshot, then exit
playbar                              # event stream on stdout
echo next | playbar                  # control via stdin
playbar --player spotify             # restrict to a specific player

Output format

Each line on stdout is a JSON object describing the current state:

{
  "player": "spotify",
  "status": "Playing",
  "artist": "Artist Name",
  "title": "Track Title",
  "album": "Album Name",
  "art_url": "file:///..."
}

Stdin commands

Send one command per line on stdin. Both plain words and JSON forms are accepted:

Command Effect
play Start playback
pause Pause playback
toggle Play/pause toggle
next Skip to next track
prev Skip to previous track
raise Focus the player window
refresh Re-emit current state

Use cases

  • Drive a tmux-powerline segment.
  • Pipe into a status bar (waybar, polybar, i3blocks).
  • Script playback controls from your shell.