Search code examples
linuxx11dbus

Does the D-bus need a UI or it can also be used in command line tools?


It seems the D-bus is a very convinent way to communicate proccesses in linux. My question is does it need a UI/x11 started before or it can also be used in command line tools without UI/x11 ?


Solution

  • The only thing D-Bus needs in order to work is the D-Bus server daemon itself. This is invoked via dbus-launch which can be integrated into shell startup scripts in the event that the X init system isn't used. Additionally, applications can attempt to execute dbus-launch themselves in order to either attempt to use a session bus created at login or to create a session bus for the application's own use. Naturally the first option (or the first result of the second option) is preferred since it will use fewer resources overall.