Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的程序中使用一个工具。例如,org.cinnamon.ScreenSaver
我可以通过使用直接在 C 中调用 shell 命令
系统(“肉桂屏保命令--lock”)
或者使用 dbus,需要会话总线,例如“/org/cinnamon/ScreenSaver”,然后调用方法“Lock()”。
我知道在 gnome 中使用 dbus 比 system() 更优雅,但我不知道它的主要优势。