SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
And I still cannot launch anything that requires dbus.
When I try to launch something such as mailspring:
Code:
[2 zypak-helper] Failed to connect to session bus: [org.freedesktop.DBus.Error.NotSupported] Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead.
And I still cannot launch anything that requires dbus.
When I try to launch something such as mailspring:
Code:
[2 zypak-helper] Failed to connect to session bus: [org.freedesktop.DBus.Error.NotSupported] Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead.
Anything that requires dbus fails.
What am I doing wrong?
dbus-launch --sh-syntax will actually print out to stdout the required environment variables that are needed for other programs to find the newly launched dbus-daemon, hence you have to wrap the dbus-launch command with "eval" then exec to dwm.
A simpler way is to just use dbus-run-session like:
Code:
exec dbus-run-session -- dwm
At the end of your xinitrc.dwm.
EDIT:
Upon reading the dbus-launch man page, specifying the program to run as dbus-launch argument should automatically set the environment variables for the program specified as the argument. So I don't know why the DBUS_SESSION_BUS_ADDRESS is not picked up by your programs.
Last edited by mumahendras3; 02-08-2022 at 11:39 PM.
EDIT:
Upon reading the dbus-launch man page, specifying the program to run as dbus-launch argument should automatically set the environment variables for the program specified as the argument. So I don't know why the DBUS_SESSION_BUS_ADDRESS is not picked up by your programs.
Yes the program launched by 'dbus-launch' should have the DBUS_SESSION_BUS_ADDRESS environment variable set. The '--sh-syntax' option is useful for setting the DBUS_SESSION_BUS_ADDRESS in the originating script, in case more programs needed to be launched and made aware of a session dbus in the same script.
With the OP using 'exec' to start dwm, setting DBUS_SESSION_BUS_ADDRESS in the xinitrc script wont be used after that line so something else is going on.
Check if the DBUS_SESSION_BUS_ADDRESS environment variable is set prior to launching mailspring. If it is then something is unsetting DBUS_SESSION_BUS_ADDRESS when you start mailspring. I'm also not sure what 'zypak-helper' is. A preliminary search shows its some sort of sandboxing app so maybe that is clearing the DBUS_SESSION_BUS_ADDRESS variable somehow when it starts up?
I've read those man pages before and didnt see anything about one method being preferred over the other so I'm not sure where you are seeing that. They both have very similar operation but dbus-launch has a few more options, where dbus-run-session is basically the same as 'dbus-launch --exit-with-session' as I understand it.
Either way, slackware uses a mix of dbus-run-session and dbus-launch across the various xinitrc and .desktop files, so we end up having to be familiar with both if you ever get into modifying those files.
The OP was not asking in this case for what is preferred, but for anything that will work. And of the two, dbus-run-session is the only one that specifically says that it is meant to run a program:
Quote:
dbus-run-session is used to start a session bus instance of dbus-daemon from a shell script, and start a specified program in that session.
I see what you meant. I thought we were talking about starting a 'dwm' X session, which can be done with either method.
The weird thing with the OP's problem was that the dbus address should have been set in the environment with either method, but the mailspring application claims it was not. Starting mailspring with dbus-run-session and no address set in the environment would just start mailspring in its own isolated session dbus, no? At any rate, I'll leave this thread for now, unless OP updates the situation.
As I mentioned in a recent post on Reddit, even if DBUS_SESSION_BUS_ADDRESS is set in the environment, dbus-run-session will change it to a unix:abstract one, run your program, then revert it to its previous value when your program exits. My Reddit post is on r/artixlinux, the subreddit of Artix Linux, which removes systemd and related annoyances like dbus. It took me a while to figure out, but as far as I'm concerned, you might as well give up on trying to set your own DBUS_SESSION_BUS_ADDRESS values, it's all been taken care of by dbus-run-session.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.