Benutzer-Werkzeuge

Webseiten-Werkzeuge


lcd4linux:plugin_dbus

DBus plugin

This plugin listens for D-Bus signals and makes their arguments available to the Evaluator. A signal can also trigger a named event, so that text widgets are updated at the very moment the signal arrives (e.g. to display an incoming instant message).

The plugin connects to the session bus and to the system bus. Up to 64 signals can be configured. The plugin was written by Edward Martin.

For controlling media players via D-Bus see the MPRIS plugin.


Configuration

The signals are configured in the section Plugin DBus. Every signal has a number (0..63), which is part of the entry names:

Plugin DBus {
    signal<n>sender    <string>
    signal<n>path      <string>
    signal<n>interface <string>
    signal<n>member    <string>
    signal<n>eventname <string>
}
signal<n>sendername of the sender in the form 'com.domain.app.service'. Optional; if unsure, leave it out. The ':1.23' form shown by dbus-monitor will not work.
signal<n>pathobject path of the signal. Required.
signal<n>interfaceinterface of the signal. Required.
signal<n>membername of the signal. Required.
signal<n>eventnamename of the event that is triggered when the signal arrives. Optional. All text widgets with a matching event entry are updated then.

Path, interface and member can be found with dbus-monitor.


Functions

dbus::argument(signal, n)returns argument number n (starting with 0) of the last received signal number signal as a string. Returns an empty string if the signal has not been received yet or has no such argument.
dbus::clear(signal)forgets the arguments of signal number signal, so that dbus::argument() returns empty strings until the signal arrives again

Example

This example (from lcd4linux.conf.sample) displays the sender and the text of the last instant message shown by Pidgin:

Plugin DBus {
    signal0sender    'im.pidgin.purple.PurpleService'
    signal0path      '/im/pidgin/purple/PurpleObject'
    signal0interface 'im.pidgin.purple.PurpleInterface'
    signal0member    'DisplayedImMsg'
    signal0eventname 'got_im'
}

Widget Pidgin {
    class 'Text'
    expression dbus::argument(0, 1) . ': ' . dbus::argument(0, 2)
    width 20
    align 'R'
    event 'got_im'
}

Requirements

libdbus (dbus-1, version 1.0.0 or newer) is needed. The plugin is selected at build time with –with-plugins=dbus.


lcd4linux/plugin_dbus.txt · Zuletzt geändert: von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki