LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

playerctl

Control MPRIS media players from command line

TLDR

Toggle play/pause
$ playerctl play-pause
copy
Skip to next track
$ playerctl next
copy
Go to previous track
$ playerctl previous
copy
List all players
$ playerctl -l
copy
Control specific player
$ playerctl -p [player_name] [command]
copy
Control all players
$ playerctl -a [command]
copy
Display metadata
$ playerctl metadata -f "Now playing: {{artist}} - {{title}}"
copy

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 playback
play
Start playback
pause
Pause playback
stop
Stop playback
next
Next track
previous
Previous track
position
Get or set position
volume
Get or set volume
status
Get playback status
metadata
Get track metadata

INSTALL

sudo apt install playerctl
copy
sudo dnf install playerctl
copy
sudo pacman -S playerctl
copy
sudo apk add playerctl
copy
sudo zypper install playerctl
copy
nix profile install nixpkgs#playerctl
copy

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.

SEE ALSO

pactl(1), mpc(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid