etc  

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: no dbus

Thunar with 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.

% dbus-launch thunar &

dbus-launch: rofi

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.

dbus-launch: *.desktop

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.

dbus: xinitrc

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.

% sudo chmod +x /etc/rc.d/rc.messagebus

% sudo /etc/rc.d/rc.messagebus start
Starting system message bus:  /usr/bin/dbus-uuidgen --ensure ; /usr/bin/dbus-daemon --system

% sudo /etc/rc.d/rc.messagebus status
System dbus-daemon is running.

dbus: messagebus daemon

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).

dbus: lightdm Xsession wrapper

I’m using LightDM - Slackware - SysVinit.

You can switch to init 3 and switchback to init 4.

% init 3

% init 4

Or just kill the DM.

% pkill lightdm

SDDM on Artix

There is also similar file in SDDM, in /usr/share/sddm/scripts/Xsession.

dbus: sddm Xsession wrapper

I’m using SDDM - Artix - OpenRC.

Restart using daemon manager.

% rc-service xdm restart

Note that this sddm run under /etc/conf.d/xdm

$ cat /etc/conf.d/xdm
# We always try and start X on a static VT.
CHECKVT=7

# What display manager do you use ? 
DISPLAYMANAGER="sddm"

Related Daemon

$ rc-service dbus status
 * status: started

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.

$ sudo service dbus status
[ ok ] dbus is running.

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.

policy: not authorized to perform


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