Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

How do I add a d-bus command as a global shortcut in Gnome (classic)? I can do it in KDE, it gives an option to add a new shortcut as a d-bus command. I do not want to write a script just for this.

share|improve this question
up vote 2 down vote accepted

Never mind, found it. Use qdbus as the command line interface:

qdbus <Remote Application> <Remote object> <Function> 

I was trying to control spotify. The playPause command would be :

qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
share|improve this answer
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause if we are in Gnome-Shell – user813182 Mar 26 '13 at 5:25

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.