playerctl
Control MPRIS media players from command line
TLDR
Toggle play/pause
SYNOPSIS
playerctl [-p player] [-a] [-l] command
DESCRIPTION
playerctl controls media players that implement the MPRIS D-Bus specification. It provides a unified command-line interface for controlling Spotify, VLC, Firefox, and many other media applications.
The tool is commonly used for keyboard shortcuts and scripts to control media playback without focusing the player window.
PARAMETERS
-p, --player _player_
Target specific player-a, --all-players
Control all players-l, --list-all
List available players-f, --format _format_
Output format template
COMMANDS
play-pause
Toggle playbackplay
Start playbackpause
Pause playbackstop
Stop playbacknext
Next trackprevious
Previous trackposition
Get or set positionvolume
Get or set volumestatus
Get playback statusmetadata
Get track metadata
CAVEATS
Requires MPRIS-compatible player. Some players have limited MPRIS support. Player must be running to be controlled. Metadata availability varies by player.
HISTORY
playerctl was created by Tony Crisci to provide a simple, reliable way to control media players from scripts and keybindings. It's widely adopted in tiling window manager setups.
