Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After googling for a while now im unable(-.-) to find a solution for this:

I want to tell my standard(as noted in settings) music/video player to play/stop/next via terminal. But with a global command and not "/usr/bin/banshee --next" for example.

Here is what i found till now: X86AudioNext(keyboard keys), xmodmap(organisation of keyboard keys).

share|improve this question
up vote 2 down vote accepted

There is no general answer to your question, since music players can implement whatever they want.

However, the default players for Ubuntu all implement the mpris2 interface (if they are integrated into the soundmenu). Therefore they can be controlled via the command line.

One possible script to use is here: pympris.

You can run it like this: play stop next

If you prefer something more basic, you can look at the mpris2 definition here.

Alternatively you can emulate the gnome multimedia keys as you already wrote in your question.

share|improve this answer
Thank you this should solve my problem. I forgot to say that it should run on a fresh Ubuntu install. So i will focus on emulating the gnome keys. If i get it i will post the result here. And if i dont get it i will use the mpris2-remote packge, its sound pretty easy. – Simon Schubert Mar 31 '12 at 11:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.