Hyphenate D-Bus

Shane Bell 2014-05-12 21:27:44 -07:00
parent 892f940abf
commit d5a37f8a9c
1 changed files with 4 additions and 4 deletions

@ -1,12 +1,12 @@
## Introduction
Clementine can be controlled remotely over DBus. [DBus](http://www.freedesktop.org/wiki/Software/dbus) is a message bus that lets applications on Linux talk to each other. It replaces DCOP that was used by KDE 3 and Amarok 1.4.
Clementine can be controlled remotely over D-Bus. [D-Bus](http://www.freedesktop.org/wiki/Software/dbus) is a message bus that lets applications on Linux talk to each other. It replaces DCOP that was used by KDE 3 and Amarok 1.4.
This guide will show you how to control Clementine from the commandline and from Python scripts.
### The specifications
MPRIS is a common API for controlling music players over DBus. Clementine supports MPRIS versions 1 and 2:
MPRIS is a common API for controlling music players over D-Bus. Clementine supports MPRIS versions 1 and 2:
- [MPRIS 1](http://xmms2.org/wiki/MPRIS)
- [MPRIS 2](http://www.mpris.org/2.1/spec/)
@ -43,7 +43,7 @@ You can see that you need to give 3 things when you use qdbus:
1. The **object path** identifying which part inside that application you want. We used `/` to list the methods on the root object.
1. The **method name** that you want to call: `org.freedesktop.MediaPlayer.Identity`. The method name is only really `Identify` in this case - everything before the final dot is known as the **interface name**.
qdbus is great for finding out what methods are available on DBus objects. It also supports tab completion.
qdbus is great for finding out what methods are available on D-Bus objects. It also supports tab completion.
### What song is playing now?
@ -62,7 +62,7 @@ The GetMetadata MPRIS 1 method gives you information about the currently playing
title: Eric The Half A Bee
tracknumber: 14
Using MPRIS 2 to get metadata is a little more difficult because it's exposed as a DBus *property* instead of a *method* that returns information. You have to call the `org.freedesktop.DBus.Properties.Get` method and give it the name of the property you want to get as an argument:
Using MPRIS 2 to get metadata is a little more difficult because it's exposed as a D-Bus *property* instead of a *method* that returns information. You have to call the `org.freedesktop.DBus.Properties.Get` method and give it the name of the property you want to get as an argument:
$ qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata