Super User is a question and answer site for computer enthusiasts and power users. 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

I have Xubuntu 11.10, XFCE. I want to send DBus signals to the players so that they worked like in Gnome: you press 'play' key, it plays, 'next' - it forwards, and so on.

For that, I need to bind to the multimedia keys a set of commands like this:

dbus-send --dest=org.gnome.Rhythmbox ...

Now, I searched and can't find it: what signals should I send? I need only 3 events: play, forward and rewind.

Here's what I managed to do so far:

culebron@vostro:~/Work/game$ dbus-send --print-reply --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox org.gnome.Rhythmbox.Play
Error org.freedesktop.DBus.Error.UnknownMethod: Method "Play" with signature "" on interface "org.gnome.Rhythmbox" doesn't exist

culebron@vostro:~/Work/game$ dbus-send --print-reply --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox org.mpris.MediaPlayer2.Play
Error org.freedesktop.DBus.Error.UnknownMethod: Method "Play" with signature "" on interface "org.mpris.MediaPlayer2" doesn't exist
share|improve this question
up vote 2 down vote accepted

The signal sent is org.gnome.SettingsDaemon.MediaKeys.MediaPlayerKeyPressed on /org/gnome/SettingsDaemon/MediaKeys, with two arguments – the target program's name, which the program itself registers, and the key pressed ("Play", "Stop", "Next", "Previous").

signal sender=:1.3 -> dest=(null destination) serial=3047
   string "gnome-mpris-keybind (mpd)"
   string "Play"

However, this will probably be of little use, since without g-s-d your player will fail to register itself and is not guaranteed to actually listen for this signal.

In some cases, you can skip this layer and control the music player directly – most players export a MPRIS2 interface at org.mpris.MediaPlayer2.playername, others have their custom interfaces which can be explored with D-Feet.

method call sender=:1.449 -> dest=org.mpris.MediaPlayer2.mpd serial=17
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .