altdesktop/playerctl logo

altdesktop/playerctl

Free

🎧 mpris media player command-line controller for vlc, mpv, RhythmBox, web browsers, cmus, mpd, spotify and others.

FreeFree tier
Outputs: text
Type
Open Source
Company
altdesktop

About altdesktop/playerctl

Playerctl is a command-line utility and library for controlling media players that implement the MPRIS D-Bus Interface Specification. It allows users to bind playback actions (play, pause, stop, next, previous) to media keys, retrieve metadata about the currently playing track (artist, title), and control volume and position. The tool includes a daemon, playerctld, which automatically tracks the most recently active media player, enabling seamless control across multiple players. Supported players include VLC, mpv, RhythmBox, web browsers, cmus, mpd, Spotify, and others. Playerctl is open-source (MIT license) and designed for integration into statusline generators, scripts, and other command-line workflows.

Key Features

Controls media players via MPRIS D-Bus interface
Supports play, pause, stop, next, previous, seek, volume, loop, shuffle commands
Retrieves metadata such as artist and title from the current track
Includes playerctld daemon for automatic tracking of the most recently active player
Allows specifying or ignoring players with --player and --ignore-player flags
Supports formatting output with --format for custom display
Can act on all players simultaneously with --all-players
Open-source command-line utility with a library interface

Pros & Cons

Pros
  • Lightweight and fast, works entirely from the terminal
  • Supports a wide range of MPRIS-compatible media players
  • Includes a daemon for automatic active player tracking
  • Open-source with permissive MIT license
  • Easy to use with simple command syntax
  • No GUI overhead ideal for headless or minimal setups
Cons
  • Only works on Linux systems with D-Bus and MPRIS-compliant players
  • No graphical user interface; entirely command-line based
  • Limited functionality for players that do not fully implement MPRIS
  • Requires some learning for advanced options like formatting and player selection

Best For

Binding media keys to control playback in Linux desktop environmentsIntegrating player status into status bar generators (e.g., polybar, i3status)Scripting media player actions for automation or custom workflowsControlling multiple media players from a single command-line interfaceRetrieving current track information for display or logging

FAQ

What is Playerctl?
Playerctl is a command-line utility and library for controlling media players that implement the MPRIS D-Bus Interface Specification. It allows binding playback actions to media keys and retrieving track metadata.
How do I select a specific player to control?
Use the --player flag followed by the player name (e.g., playerctl --player=spotify play). You can list available players with playerctl --list-all. To control all players, use --all-players.
What is playerctld?
playerctld is a daemon that monitors media player activity and makes Playerctl act on the most recently active player. Start it by running 'playerctld daemon' in your startup script.
What commands does Playerctl support?
Supported commands include play, pause, play-pause, stop, next, previous, position (seek), volume, status, metadata, open, loop, and shuffle. Each command controls the corresponding player action.
How can I get metadata from the current track?
Use 'playerctl metadata' to print all metadata. To get a specific key like artist or title, pass the key name (e.g., playerctl metadata artist).