On Thu, Nov 23, 2023 at 10:52:25PM +0700, Max Nikulin wrote: > On 23/11/2023 21:02, Greg Wooledge wrote: > > Usually, creating ~/.xsessionrc (on Debian only, as it's specific to > > Debian) will suffice for this, as it gets read in by the X session > > before it spawns your window manager, and then the WM spawns everything > > else, all with your desired environment. (Again, assuming X, not Wayland.) > > I would verify that changes are reflected in > > systemctl --user show-environment > > output. XDG autostart instances, applications activated through D-Bus may be > spawned by systemd user session, not X session & window manager.
Well, the important thing here is knowing what's spawned by whom, in your particular setup. In a traditional window manager setup like I use, *nothing* is spawned by dbus or by the systemd --user manager. (Well, maybe not nothing. Maybe pulseaudio or whatever does audio now? I have no idea how that stuff works. I just login, check whether audio works, and if it does, I *do not touch it*.) If you've got things that are actually spawned by systemd --user, then this may be relevant for you. For me, it's not. Nothing that I put in any of the files mentioned in environment.d(5) has EVER become part of my environment upon login. I've been down all of these roads before, you see. For me, all of the environment.d(5) stuff goes into the systemd --user service manager which spawns... nothing that's visible to me. Nothing at all. All of my visible applications (terminals, web browsers, etc.) are spawned by my window manager, which is spawned by my X session, which is spawned by startx, which is spawned by my console login shell, when I type the "startx" command. So, for *me*, configuring the environment in my login shell's dot files works. > Greg, do you have ideas how to relieve pain with environment configuration? > E.g. to not override pam_environment by PATH hardcoded in /etc/profile, to > negotiate what files display managers should read, etc. Didn't I just post a long message about this? People have been searching for this holy grail for DECADES. It does not exist.