Detect new available names in bus
Sergio Costas
rastersoft at gmail.com
Mon Feb 14 22:51:48 UTC 2022
Hi all:
I want to detect if the user has installed a service that offers the
well-known name "org.gnome.ArchiveManager1" (usually it is offered by
file-roller). I can do a call to "NameHasOwner()" and it will return
TRUE if that name is registered, even if the service is not active
(because it is launched on demand), or FALSE if it isn't available
(because the package "file-roller" isn't installed). But I haven't been
able to detect when that name becomes available unless the service is
launched. There seems to be no signal just for the act of "registering"
a service that offers a well-known name (this is: if the package isn't
installed and I install it, DBus should detect that there is a new file
at "/usr/share/dbus-1/services/" called
"org.gnome.ArchiveManager1.service", and notify that the service is
available on-demand).
I tried connecting to 'NameOwnerChanged' but it only notifies when the
well-known name is acquired by the program, which means that it must be
launched to detect it. But since it is an on-demand service, it is only
launched if a program does a call to an interface on the well-known
name. I also tried with 'NameAcquired' and 'NameLost', but I receive
nothing (if I understand correctly the documentation, they seems to be
emitted only to the service itself, but not to others). Also tried with
'PropertiesChanged', but nothing is emitted when the file gets installed.
Is there a way of detecting this via events? I don't want to do neither
a periodic polling, nor manually monitoring all the folders where
service files can be added.
Thanks!
--
Nos leemos
RASTER (Linux user #228804)
rastersoft at gmail.com https://www.rastersoft.com
More information about the dbus
mailing list