PLAYERCTL(1)
π PLAYERCTL π
okay bestie, welcome to the playerctl(1) manual page, general commands section, and yes this is THE one β the little command-line baddie that runs your music π
β¨ NAME β¨
playerctl β control media players via MPRIS. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
playerctl [-aFhlV] [-f FORMAT] [-i NAME] [-p NAME] command
π¦ DESCRIPTION π¦
so the playerctl utility controls MPRIS-enabled media players. no cap. and it's not just play/pause/stop β it also does previous and next track, it can seek backwards and forwards inside a track, and yes queen, it does volume control. it can also show you metadata for the current track (like artist, title, album), and print the player's status. it's giving full remote control π«Ά
players you can control with playerctl include audacious(1), cmus(1), mopidy(1), mpd(1), quodlibet(1), rhythmbox(1), vlc(1) and xmms2(1). BUT β and this is the iconic part β any player that implements the MPRIS interface specification works too, web browsers included. your browser is a media player now, we don't make the rules π
also, playerctl ships with a daemon called playerctld that keeps track of media player activity. when playerctld is running, playerctl commands act on the media player with the most recent activity. to start the daemon, run the command playerctld daemon. main character energy fr fr π
the options are as follows:
-a,--all-playersβ apply the command to all available players. every single one. we're going wide π’-F,--followβ block and output the updated query when it changes. it just sits there and watches. patient king π§-f FORMAT,--format FORMATβ set the output of the current command to FORMAT. go read "Format Strings" below, it's important π-h,--helpβ print this help, then exit. bye π-i NAME,--ignore-player NAMEβ ignore the specific player NAME. you can list multiple players in a comma-separated list. not you, not you, not you π«-l,--list-allβ list the names of running players that can be controlled. roll call β¨-p NAME,--player NAMEβ control the specific player NAME. multiple players can go in a comma-separated list. defaults to the first available player. the name"name"matches both"name"and"name.{INSTANCE}". plus, the name"%any"matches any player. choose your fighter π-s,--no-messagesβ silence some diagnostic and error messages. shhh π€«-V,--versionβ print version number, then exit.
the commands are as follows:
statusβ get the current status of the player.playβ command the player to play.pauseβ command the player to pause.play-pauseβ command the player to toggle between play and pause. the indecisive icon πstopβ command the player to stop.nextβ command the player to skip to the next track.previousβ command the player to skip to the previous track.position [OFFSET[+|-]]β print the position of the current track in seconds. with OFFSET specified, seek to OFFSET seconds from the start of the current track. with the optional[+|-]appended, seek forward or backward OFFSET seconds from the current position. math but make it music πvolume [LEVEL[+|-]]β print the player's volume scaled from0.0(0%) to1.0(100%). with LEVEL specified, set the player's volume to LEVEL. with the optional[+|-]appended, increase or decrease the player's volume by LEVEL.metadata [KEY]β print all metadata properties for the current track set by the current player. if KEY is specified, only the value of KEY is printed.open URIβ open URI in the player. URI may be the name of a file or an external URL.shuffle [On | Off | Toggle]β print the shuffle status of the player. with the shuffle status specified, set the shuffle status to eitherOn,Off, orToggleloop [None | Track | Playlist]β print the loop status of the player. with the loop status specified, set the loop status toNone(disable looping),Track(loop the current track), orPlaylist(loop the current playlist). we love a repeat situation π
π Format Strings π
the output of the position, metadata, status and volume commands can be controlled using a format string. variables set by these commands get included in the format string by wrapping them in curly braces: {{var}}. these then get expanded on output. obsessed β¨
each command has access to the following variables:
playerNameβ the name of the current player.positionβ the time position of the current track, in microseconds.statusβ the status of the current player.volumeβ the player's volume scaled from0.0(0%) to1.0(100%).
each property listed in the metadata command is also set as a variable. highkey recommended to check this list for each player, because different players may not set the same properties. see the MPRIS v2 metadata guidelines for a list of all properties in the MPRIS specification. the most common properties are as follows:
album,xesam:albumβ the album of the current track.artist,xesam:artistβ the artist of the current track.title,xesam:titleβ the title of the current track.
helper functions are also available to transform expanded variables into other representations. you call them in the form {{func(var)}}. the helper functions are as follows:
lc(str)β convert string str to lowercase.uc(str)β convert string str to uppercase.markup_escape(str)β escape XML characters in string str.default(str1, str2)β print str1 if set, else print str2.duration(time)β reformat the microsecond timestamp time in the formhh:mm:ss. can only be called withpositionormpris:length.emoji(key)β try to convert the value for key to an emoji representation. currently implemented forstatusandvolume. πtrunc(str, len)β truncate str to a maximum of len characters, adding an ellipsis (β¦) if necessary.
the template language is also able to perform basic math operations.
β οΈ references to unknown functions will cause playerctl to exit with an error. references to unknown variables will be expanded to empty strings. text not enclosed in braces will be printed verbatim. so like, be careful bestie π
π EXIT STATUS π
the playerctl utility exits 0 on success, and >0 if an error occurs. clean exit = slay, non-zero = something went wrong π
π EXAMPLES π
print the player name, playback status in lowercase, and position and length in human readable form:
$ playerctl metadata --format '{{playerName}}: {{lc(status)}} '\
'{{duration(position)}}|{{duration(mpris:length)}}'
π SEE ALSO π
- MPRIS v2 metadata guidelines, freedesktop.org,
https://freedesktop.org/wiki/Specifications/mpris-spec/metadata/, September 18, 2013. - playerctl homepage:
https://github.com/altdesktop/playerctl - playerctl API documentation:
https://dubstepdish.com/playerctl - GObject introspection language bindings:
https://wiki.gnome.org/Projects/GObjectIntrospection/Users
π AUTHORS π
the playerctl utility is maintained by Tony Crisci <tony@dubstepdish.com> and is made available under the GNU Lesser General Public License 3.0.
this reference was written by Nick Morrott <knowledgejunkie@gmail.com> for the Debian GNU/Linux project. it was later updated and expanded by Stephen Gregoratto <dev@sgregoratto.me>.
okay that's the whole page, you're a playerctl expert now, no cap π
and for the cute sign-off: this lil masterpiece came from the Debian fam, dated September 21, 2021, and it lives under the general commands manual for playerctl(1). go control some media, bestie β¨π¦πΈ
π¦ where this page comes from
- alpine 3.24: playerctl-doc 2.4.1-r3 Β· LGPL-3.0-or-later
- arch rolling: playerctl 2.4.1-5 Β· LGPL-3.0-only
- debian bookworm: playerctl 2.4.1-2 Β· LGPL-3.0-or-later
- debian trixie: playerctl 2.4.1-3 Β· LGPL-3.0-or-later
- epel 9: playerctl 2.4.1-4.el9 Β· LGPLv3+
- fedora 43: playerctl 2.4.1-11.fc43 Β· LGPL-3.0-or-later
- fedora 43: playerctl 2.4.1-11.fc43 Β· LGPL-3.0-or-later
- fedora 44: playerctl 2.4.1-12.fc44 Β· LGPL-3.0-or-later
- fedora 44: playerctl 2.4.1-12.fc44 Β· LGPL-3.0-or-later
- nixos 26.05: playerctl 2.4.1
- nixpkgs unstable: playerctl 2.4.1
- opensuse-leap 16.0: playerctl 2.4.1-bp160.1.8 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: playerctl 2.4.1-bp160.1.8 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: playerctl 2.4.1-bp160.1.8 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: playerctl 2.4.1-bp160.1.8 Β· LGPL-3.0-or-later
- ubuntu jammy: playerctl 2.4.1-1 Β· LGPL-3.0-or-later
- ubuntu noble: playerctl 2.4.1-2build2 Β· LGPL-3.0-or-later
- ubuntu questing: playerctl 2.4.1-3
- ubuntu resolute: playerctl 2.4.1-3build1 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms