# $system.dbus

Performs a DBus call

Usage

    $system.dbus(<service>,<path>,<interface>,<method>[,<bus_type>[,<parameter1>[,<parameter2>[,...]]]])

Description

This function allows performing simple Dbus calls without executing an external process. This feature is available ONLY under unix: this means that this function is absolutely non portable (don't use it in scripts that you're going to distribute). <application> is the name of the application being called, <objectid> is the identifier of the object called, <function> is the function to be executed on the remote object and <parameter1>,<parameter2>,... is the list of parameters to be passed. The <function> name must contain the trailing parenthesis and parameter specification (see examples). The <bus_type> specifies the bus to connect, use "system" for systemBus or "session" for sessionBus. If it's leaved blank, it will use sessionBus. The parameters MUST be in the form "type=value" where "type" is the C++ type of the parameter and value is the string representation of the parameter data. Currently KVIrc supports only QString,QByteArray,bool,int and uint data types.
The returned value is the string representation of the returned data if the return type is known, otherwise it is the name of the data type returned.
If the service name is prefixed with "?" then the call is performed in "remote test" mode: no "remote" errors are printed and the function returns 1 if the call executed successfully and 0 if the call failed. This can be used with the very first call to programmaticaly test if the remote application is running.

Syntax Specification

    <variant> $system.dbus(<service:string>,<path:string>,<interface:string>,<method:string>[,<bus_type:string>[,<parameter1:string>[,<parameter2:string>[,...]]]])

Examples

        #get a string list of torrents currently in queue in ktorrent
        echo $system.dbus("org.ktorrent.ktorrent","/KTorrent", "org.ktorrent.KTorrent","torrents")
        #stop a torrent in ktorrent by its name
        echo $system.dbus("org.ktorrent.ktorrent","/KTorrent", "org.ktorrent.KTorrent","stop","QString=Torrent Name")
        #start the kde task manager
        echo $system.dbus("org.freedesktop.ScreenSaver","/App", "org.kde.krunner.App","showTaskManager")
        #get the clipboard contents using dbus
        echo $system.dbus("org.kde.klipper","/klipper", "org.kde.klipper.klipper","getClipboardContents")

Index, Functions

KVIrc 4.2.0.6190 Documentation
Generated by portbuild at Mon Aug 12 12:09:14 2013