====== DBus plugin ====== This plugin listens for D-Bus signals and makes their arguments available to the [[:lcd4linux:Evaluator|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 [[:lcd4linux:plugin_mpris_dbus|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 { signalsender signalpath signalinterface signalmember signaleventname } |**signalsender**|name 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.| |**signalpath**|object path of the signal. Required.| |**signalinterface**|interface of the signal. Required.| |**signalmember**|name of the signal. Required.| |**signaleventname**|name of the event that is triggered when the signal arrives. Optional. All [[:lcd4linux:widget_text|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//. ----