Linux 如何从命令行发出 dbus 信号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3684999/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to emit dbus signal from command line
提问by deimus
Is there a way to emit dbus signal from command line using dbus-send or something else ?
有没有办法使用 dbus-send 或其他方式从命令行发出 dbus 信号?
采纳答案by m__
You can use the utility dbus-send
to send D-Bus request from the command line.
您可以使用该实用程序dbus-send
从命令行发送 D-Bus 请求。
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"
回答by Stefan George
Check the syntax of dbus-send! It's not that complicated as it seems!
检查 dbus-send 的语法!这并不像看起来那么复杂!