Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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:

mpris2-remote.py play

mpris2-remote.py stop

mpris2-remote.py 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

 
discard

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.