Difference between revisions of "Projects/Marble/MarbleDBus"

Jump to: navigation, search
Line 30: Line 30:
  
  
 +
----------------
 +
----------------
  
This article is a stub, please extend it.
+
==Trouble shooting==
 +
===No MarbleWidget or MarbleMap===
 +
<b>Problem:</b> Neither the MarbleMap nor the MarbleWidget interfaces are available in my installation (Debian lenny), and qdbus complains:
 +
<code>
 +
org.freedesktop.DBus.Error.UnknownObject (No such object path '/MarbleWidget')
 +
</code>
 +
 
 +
<b>Solution:</b> ???

Revision as of 07:49, 6 March 2009

Scripting Marble from the shell using D-BUS

MarbleWidget and MarbleMap provide their full amount of methods as a D-BUS Interface. Therefore you can easily create a shell-script to control Marble using the qdbus command line tool.

Before you start you need to find out the PID of the Marble process: In your script you can do it like this.

marble_pid="$(pidof marble)"


Then you can pass this PID to the actual qdbus call

qdbus org.kde.marble-$marble_pid /MarbleWidget


This call returns a list of all the methods that MarbleWidget supports. From this list you can choose the one that you'd like to call, e.g.

qdbus org.kde.marble-$marble_pid /MarbleWidget org.kde.MarbleWidget.zoomIn


to zoom into the map. Note that for function calls you shouldn't pass the brackets "()".

As a convenient tool you can use qdbusviewer to get a graphical list of the interfaces and methods that get provided through D-BUS.




Trouble shooting

No MarbleWidget or MarbleMap

Problem: Neither the MarbleMap nor the MarbleWidget interfaces are available in my installation (Debian lenny), and qdbus complains: org.freedesktop.DBus.Error.UnknownObject (No such object path '/MarbleWidget')

Solution: ???


KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal