Eu não estou familiarizado com o GJS (definitivamente vale a pena investigar), no entanto, se houver uma interface de linha de comando do GJS, o dbus-monitor
poderá rastrear o d-bus por qualquer atributo de mensagem.
Citando man dbus-monitor
:
EXAMPLE
Here is an example of using dbus-monitor to watch for the gnome typing
monitor to say things
dbus-monitor "type='signal', \
sender='org.gnome.TypingMonitor', \
interface='org.gnome.TypingMonitor'"
e
In order to get dbus-monitor to see the messages you are interested in,
you should specify a set of watch expressions as you would expect to be
passed to the dbus_bus_add_match function.
e citando D-Bus: APIs do barramento de mensagens: função dbus_bus_add_match :
Possible keys you can match on are type, sender, interface, member,
path, destination and numbered keys to match message args
(keys are 'arg0', 'arg1', etc.). Omitting a key from the rule indicates
a wildcard match. For instance omitting the member from a match rule but
adding a sender would let all messages from that sender through regardless
of the member.
Observe que o remetente é identificado na saída do seguinte
O problema de muita saída de
dbus-monitor "type='signal'"
como
...
signal sender=:1.47 -> dest=(null destination) serial=1679 path=/org/ayatana/bamf/application311805604; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.ayatana.bamf.view"
array [
dict entry(
string "Active"
variant boolean true
)
]
array [
]
...
signal sender=:1.51 -> dest=com.canonical.Unity.Panel.Service serial=1674 path=/com/canonical/Unity/Panel/Service; interface=com.canonical.Unity.Panel.Service; member=ReSync
string "libappmenu.so"
...
signal sender=:1.51 -> dest=com.canonical.Unity.Panel.Service serial=1681 path=/com/canonical/Unity/Panel/Service; interface=com.canonical.Unity.Panel.Service; member=ReSync
string "libdatetime.so"
...
pode ser removido ou combinado com combinações:
-
dbus-monitor --profile "type='signal'"
-
dbus-monitor "type='signal'" | grep '...some pattern...'
-
dbus-monitor "type='signal', interface='...'"
ou outra chave em vez de interface
etc.
A última variante pode ser mais aplicável para encontrar um signal
no d-bus "that implements the interface"
.
Marcador:
Gnome Shell JS - Ouça o sinal DBus em uma interface para qualquer caminho