All Unkept
Posted in: Python, Music, Linux  —  July 15, 2010 at 04:23 PM

player_do — control multiple media players from a single (command line) interface

by Luke Plant

I tend to use several music/media players, such as shell-fm, moc and Clementine. And I often try out new ones. In order to be able to use the media buttons on my keyboard for pausing/skipping, I wrote this player_do Python script to automatically route the commands to the right one.

Quick start:

  • sudo easy_install playerdo

    Or, if you prefer this way like me, and have $HOME/.local/bin on your $PATH:

    easy_install --prefix=$HOME/.local playerdo

  • player_do help

    Then use your window manager/desktop to setup keyboard shortcuts to player_do playpause, player_do next etc.

mpris-remote does a similar job, but only for MPRIS players, and I needed others. My script also has an MPRIS backend, so it will support XMMS2, Amarok, Clementine, Exaile, Dragon Player and various others out of the box. It also has support for shell-fm, moc, and rhythmbox.

If you have more than one running at a time, it tries to be intelligent about which one to talk to, although of course it is not always possible to read your mind correctly!

For other players that don't support MPRIS it should be quite easy to add a backend — please fork the bitbucket repository, have a look at the existing backends and send me your patches!

Comments §

blog comments powered by Disqus