Skip to main content

player_do provides a simple command line interface to control whatever media player is running on your computer. It has been designed for and tested on Linux.

It is designed to allow you to configure the media buttons on your keyboard (play, pause, next etc.) to Do The Right Thing without having to change anything if you switch to a different media player.

It also includes commands install_gnome, install_mate, install_gnome3, and install_cinnamon to help set up keyboard shortcuts initially on GNOME2/Mate/GNOME3/Cinnamon. It can, however, be used with any system where you can map keyboard shortcuts to commands.

The currently supported media players can be seen by running player_do --help. Those that have been tested include the following:

  • Audacious

  • Amarok

  • Banshee

  • Clementine

  • cmus

  • Exaile

  • Guayadeque

  • moc

  • MPD (configurable using MPD_HOST and MPD_PORT environment variables like mpc)

  • pianobar

  • Quodlibet

  • Rhythmbox (needs MPRIS plugin installed and enabled)

  • shell-fm (0.8 and later)

  • VLC (2.0 and later)

  • Firefox, Chrome (when playing some media like videos and podcasts)

Many other players will be supported due to support for the MPRIS DBUS protocol, without a specific backend. If you only need support for those players, consider using MPRIS-remote or playerctl.

To add more supported programs, see the existing code in the backends directory. Patches gratefully received!

Installation

You need Python 3.8 or later, Python 3.12 or later recommended as I test on that. We recommend the use of uv to install as below:

uv python install 3.12
uv tool install playerdo --python 3.12

This should install everything for you.

Installation using pipx

On older systems or if uv is not available, you can install using pipx to install it into its own virtualenv, using your standard system Python 3, with “system” libraries available (due to the DBUS requirementw):

pipx install playerdo --system-site-packages --python `which python3`

You will also need to install Python DBUS bindings. We recommend doing this at the system level. On Debian-like systems this is usually done with one of the following packages:

python-dbus
python3-dbus

An alternative to system-level Python DBUS is to use pipx to install them:

pipx inject playerdo dbus-python

(If an appropriate binary wheel for dbus is not found, the above may require development packages to be installed, including libglib2.0-dev and libdbus-1-dev and Python development headers).

After installation, you can use player_do test to ensure everything expected is available. It’s normal to see error messages relating to players that you do not use or have installed.

Usage

Control the currently active player using commands like:

player_do playpause
player_do next

For all commands and other options, see:

player_do --help

Release files for playerdo 2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for playerdo 2.2
File Size Uploaded
playerdo-2.2.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for playerdo 2.2
File Interpreter ABI Platform
playerdo-2.2-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / playerdo-2.2.tar.gz

Download URL playerdo-2.2.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b40d3fff715f1a88ff3750ae656c232aad30348520c4437842061f8602bfbfb9
BLAKE2b-256 checksum
How to use checksums
49e6ac8259dca795c6a340ebaaa26357ecaa9f8f0525bbce698a717abff4e5bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release files / playerdo-2.2-py3-none-any.whl

Download URL playerdo-2.2-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f65c42b74fd031e4da2c156fcd71f67bdb8de812d50b311da9d8fbad10f4850b
BLAKE2b-256 checksum
How to use checksums
092f58b671b9170598b9b921a895107644ab70958fe9dbc25ce13ba3ebab70fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release history Release notifications | RSS feed

This release

2.2 This release

2 release files

2.1

2 release files

2.0.1

2 release files

2.0

2 release files

1.0

2 release files

0.9

1 release file

0.7

1 release file

0.6.1

1 release file

0.6

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page