[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DBUS signals?



On 26/9/24 7:30 am, Jussi Lahtinen wrote:
I took this code from here <https://gambaswiki.org/wiki/doc/dbus>:

MySignal = New DBusSignal(DBus.System, "org.freedesktop.Hal.Manager") As "DBusSignal"

Public Sub DBusSignal_Signal(Signal As String, Arguments As Variant[])
 Debug Signal
End

Plugging in/out USB stick or mouse does not give any signal. What this should detect? I have never used DBUS before... is there some other signal that would be good for testing purposes? I would like to see basic things working before doing anything else.

The main goal right now is to detect system shutdown. And no, SIGTERM is not used for GUI applications anymore. I miss the old simple way.


Jussi

You'll need to tell it the object and the signal-name and set "every" to true in the "new" parameters. See the gb.dbus wiki page for details.

I'd give you better details but my system doesn't use Hal.Manager

The IDE gives some dbus introspection in the bottom tabs (I forget where).
qDBusViewer (available on your distro?) is a good utility to look at what DBus is happening on your system.

Signals are possibly the hardest way to learn about the dbus component and dbus in general.

best wishes

b


Follow-Ups:
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
References:
DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>