Playerctl is a command-line utility and library for controlling media players that adhere to the MPRIS specification. It communicates with media players over D-Bus, allowing users to issue playback commands, retrieve track metadata, and monitor playback status in real time.
The tool supports targeting a specific player by name, controlling all active players simultaneously, or following the most recently active one. It provides an event-driven subscription model for receiving real-time updates on track changes and playback state without polling, and includes a Python library for scripting integration.
Playerctl offers comprehensive playback control including play, pause, stop, next, previous, seek, and volume commands, along with the ability to toggle shuffle and repeat modes. It also enables continuous output of metadata and status changes for use in desktop status bars and scripts.