home / media / playerctl

playerctl

2.9k

Linux media control CLI for inspecting and controlling MPRIS-enabled players over D-Bus.

$sudo dnf install playerctl
Language
C
Stars
2,866
Category
Media & Video
Agent
AI Analysis

playerctl is a Linux CLI for querying and controlling media players that expose the MPRIS interface on the session D-Bus. It gives the shell a simple way to drive playback and read track state from apps like VLC, mpv, browsers, or Spotify without scripting D-Bus directly.

What It Enables
  • Play, pause, stop, skip, seek, change volume, toggle shuffle or loop, and open URIs on the current player or a selected set of players.
  • Read status, position, and track metadata for status bars, notifications, or shell scripts, with custom output formatting.
  • Watch playback changes over time with follow mode and target the most recently active player through the bundled playerctld daemon.
Agent Fit
  • Commands are direct, non-interactive, and return failing exit codes when no player is found or a command cannot be handled.
  • Inspection output is plain text or custom-formatted strings only; there is no JSON mode, so downstream parsing is brittle.
  • Best for Linux desktop automation where an agent needs to drive an already running MPRIS-capable player rather than browse or manage a media service account.
Caveats
  • Requires a Linux session D-Bus and players that implement MPRIS; some apps need plugins or desktop-session environment fixes before they appear.
  • Scope is local playback control and metadata, not library search, playlists, or remote service management.