Preface:
Goal: Solving dbus session in non-systemd environment
Table of Content
Issue in Figure
If you are moving to non-systemd environment, you might notice that your window manager might behave differently. I mean, there is no such different with Desktop Environment, but Window Manager under Desktop Manager does not contain dbus session. In short dbus session is not working under certain circumstances,
-
no removable drive,
-
other partition not shown,
-
operation permitted for root only,
-
and so on.
It will be easier to figure out the issue with figures.
Thunar without dbus
Thunar with dbus
Solution
There are at least three solutions to run dbus to suit your needs.
-
Application level
-
Window Manager Session
-
System Wide, under Desktop Manager
This is not really a desktop tutorial, but more like a system case.
1: Application Level
All you need is to type dbus-launch
.
But typing repetitively over and over again, could be cumbersome.
2: Window Manager Session
Another temporary workaround is to mess *.desktop
files,
that is located in /usr/share/xsessions/
,
by adding dbus-launch
in Exec
line.
This is also not the best practice, since I have to edit every Window Manager after installation procedure.
3: Init 3: Using startx
dbus run without any issue in this init.
I can run startx
in init 3
after login.
And voila, the mighty thunar will show my storage device.
In Slackware you can use xwmconfig
,
that will create .xsession
in home directory.
Do not forget to remove .xsession if you want to use init 4
Here is an example of xinitrc
.
It also has dbus-launch
in it.
No need to alter anything. Everything works well here.
4: Init 4: Using Desktop Manager
This is where the most issue happened. The solution depends on the Desktop Manager.
Intead of different DM, I also give different tiers [DM - distro - init]:
-
LightDM – Slackware - SysVinit.
-
SDDM - Artix - OpenRC
-
SLiM - Devuan - SysVinit
Before you begin, make sure dbus service is actively running.
LightDM on Slackware
Activate the messagebus daemon first.
Now we can simply use LightDM’s Xsession wrapper,
by altering the /etc/lightdm/Xsession
,
and add dbus-launch
in exec
line
(the last line).
I’m using LightDM - Slackware - SysVinit.
You can switch to init 3
and switchback to init 4
.
Or just kill the DM.
SDDM on Artix
There is also similar file in SDDM,
in /usr/share/sddm/scripts/Xsession
.
I’m using SDDM - Artix - OpenRC.
Restart using daemon manager.
Note that this sddm run under /etc/conf.d/xdm
Related Daemon
SLiM (or XDM) on Devuan
There is not much to say with this Devuan. dbus with WMs works properly without further configuration.
Unless you do not turn off the dbus daemon, your dbus will be fine.
5: Session
If you have policy issue with message ‘not authorized to perform’
while mounting device form Thunar,
you can run lxsession
from terminal to enable it.
Credits
Thank you to folks at Slackware Indonesia Telegram Group, for being a good company while solving these dbus issues.
Your ideas pointing to right direction.
Conclusion
That’s all
It works.
Thank you for reading