Eu não sou um guru do Linux, mas parece que dbus-monitor
é de fato a ferramenta a ser usada.
Uma resposta para a postagem Como criar um daemon que estaria escutando o script dbus e fire na mensagem diz:
O artigo Monitoramento do D-Bus adiciona:
Probably the most powerful feature of dbus-monitor is the fact that you are not limited to using just one watch expression at a time. The following example simultaneously monitors all 3 Tomboy signals and uses awk to parse the output from dbus-monitor and display a meaningful message.
#!/bin/bash OJECT="'org.gnome.Tomboy'" IFACE="'org.gnome.Tomboy.RemoteControl'" DPATH="'/org/gnome/Tomboy/RemoteControl'" WATCH1="type='signal', sender=${OJECT}, interface=${IFACE}, path=${DPATH}, member='NoteAdded'" WATCH2="type='signal', sender=${OJECT}, interface=${IFACE}, path=${DPATH}, member='NoteSaved'" WATCH3="type='signal', sender=${OJECT}, interface=${IFACE}, path=${DPATH}, member='NoteDeleted'" dbus-monitor "${WATCH1}" "${WATCH2}" "${WATCH3}" | \ awk ' /member=NoteAdded/ { getline; print "Created note " substr($2,7) } /member=NoteSaved/ { getline; print "Added note " substr($2,7) } /member=NoteDeleted/ { getline; print "Deleted note " substr($2,7) } '
Here is the output generated when I clicked on the Tomboy icon to create a new note, waited for the automatic save and then selected the delete option to delete the note.
$ ./test Created note //tomboy/3da026dc-f6ee-4637-8a94-bec6e2844824" Added note //tomboy/3da026dc-f6ee-4637-8a94-bec6e2844824" Deleted note //tomboy/3da026dc-f6ee-4637-8a94-bec6e2844824"