How to emit dbus signal from command line

deimus picture deimus · Sep 10, 2010 · Viewed 17.8k times · Source

Is there a way to emit dbus signal from command line using dbus-send or something else ?

Answer

m__ picture m__ · Sep 15, 2015

You can use the utility dbus-send to send D-Bus request from the command line.

dbus-send --system --type=signal / com.example.signal_name

or if you'd like to send some data with the signal

dbus-send --system --type=signal / com.example.signal_name string:"hello"