D-Bus
A tested inter process communication construct. There is no tutorial that just explains it as it is.
This one comes closest : visit
On a Linux workstation you normally get 2 types if Bus's. The system bus, used for system processes, and a session bus that get's started when you log in to the x server. You can use d-feet to show you the connections on each bus, and you can clearly see at the top there us a System bus and a Session Bus.
But if you do not have an Xsession, you can't start up d-feet. You can however list them with these very simple python programs.
There is a command line tool dbus-send as well, but if you view the syntax, I prefer the python version:
| send | |
|---|---|
Now if you try both scripts on a headless workstation or server you will find that the systembus works, but the session bus says:
| exception | |
|---|---|
So it seems there is some sort of automatic launching involved when you run an xserver. But we can start one manually with this command :
This lists a lot less than on an xserver, but hey we just started it. Outside this bash session we still cannot run the session list script, so it would be nice to start a session like under the X server. In the package dbus-x11 there is a tool that can do that.
It spits out a lot of info, which you must save, or directly activate in other sessions.
| set session variables | |
|---|---|
These are formatted as environment variables, so try and apply them to all windows you want to use, the DBUS_SESSION_BUS_ADDRESS seems to do the trick already, but maybe the other one is needed somewhere else so apply both :
| set session variables | |
|---|---|
There is a C example on this site : visit For a hands on example, that works Ok to refresh your memory.
See keyring for some more d-bus usage.