[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: customize Debian 11 evironment in lightdm (and in general?)



Hello Greg and David,

as I said, please leave me in Cc: as I'm not subscribed

Greg Wooledge <greg@wooledge.org> writes:

> On Fri, May 06, 2022 at 09:14:20AM +0200, Giovanni Biscuolo wrote:
>> Sorry I did not mention I'm not subscribed to the mailing list,
>
> OK.
>
>> Actually I'm not configuring it in any way, the systemd user environment ("systemdctl
>> --user show-environment") I get is the result of the default Debian
>> systemd user configuration, including XDG_DATA_DIRS: I simply dont' know
>> what is configuring that
>
> Ah.  So the systemctl --user stuff is completely irrelevant?  You only
> thought it had some meaning, so you kept mentioning it.

I mentioned because I'm still curious to understand why in "systemctl
--user" stuff I have "XDG_DATA_DIRS=/home/patrizia/.guix-profile/share"
that is /part/ of what $GUIX_PROFILE/etc/profile (sourced in my
.xinitrc) is exporting for XDG_DATA_DIRS

>> I don't have the same laptop at hand now, but on another laptop with the
>> same problem (using gdm3 as display manager) the LXTerminal is a child
>> of gdm-session-worker (lightdm when i checked yesterday on the other
>> laptop)
>
> That's *completely* different from what David showed:
>
>> Inside lxterminal:
>> [david@kablamm ~]$ pstree -s $$
>> systemd───lightdm───lightdm───lxsession───lxpanel───x-terminal-emul───bash───pstree

On my laptop, inside LXTerminal:

--8<---------------cut here---------------start------------->8---

systemd---gdm3---gdm-session-wor---gdm-x-session---lxsession---lxpanel---lxterminal---bash---pstree

--8<---------------cut here---------------end--------------->8---

I see non difference except I have gdm3 (and related session manager)
instead of lightdm (on this laptop, different from the one of my first
message)

[...]

>> It /should/ come from the sourced $GUIX_PROFILE/etc/profile but the
>> content is reset (?) by "something" after the .xsession sourcing and
>> before the X session process spawn (?)
>
> The whole point of putting variables in .xsessionrc is so that they
> become part of the Xsession process, and are therefore inherited by
> all of its children.  In a normal setup, that includes any programs
> launched from .xsession (if it exists), or your x-session-manager or
> x-window-manager program.

Thank you for your explanation: I can absolutely confirm that this is
what is happening with my Xsession environment (inherited by the window
manager and thus by the "menu manager" and by LXTerminal) /except/ for
XDG_DATA_DIRS that is reset /after/ .xsessionrc is read by my Xsession
manager

> Also in a normal setup, a terminal is created as a child of the Xsession,
> or as a child of the window manager.

AFAIU this is also what is happening on my laptop, given that lxterminal
is an (indirect) child of lxsession

> However, you're saying that your terminal is a child of "gdm-session-worker"
> (whatever that is, clearly some part of gdm3).
>
> That process does *not* contain your .xsessionrc variables, so anything
> spawned by it won't have them either.

I'm sorry I was not clear enough, but all my processes /do/ contain
.xsessionrc variables, except for XDG_DATA_DIRS that is reset by
"something"

>> As I said (and forgot to mention in my first message, sorry), all other
>> env variables exported by $GUIX_PROFILE/etc/profile (via .xsessionrc)
>> are actually inherited, all but XDG_DATA_DIRS that is /replaced/ with a
>> "hardcoded" (?) value:
>
> I don't know what to tell you here.  If your terminal is launched as a
> child/grandchild of gdm, and does *not* inherit from the Xsession, then
> it's not getting those variables from your .xsessionrc file.
>
> Maybe it's getting them by some other means.

No , because in my ~/.xsessionrc (and only there) I have this variable:

--8<---------------cut here---------------start------------->8---

export XSESSION_WAS_HERE="Yes"

--8<---------------cut here---------------end--------------->8---

and if I check that variable via "env | grep HERE" in an LXTerminal
(or xterm, ot Mate terminal) started in LXDE I can see that variable is
configured;  this is why I'm pretty sure my ~/.xsessionrc is actually
inherited by my Xsession

>> Actually there is environment.d [3] but I still have not tried that
>> approach,
>
> I went down that rabbit hole once or twice.  Maybe I can save you some
> time by letting you know that it WILL NOT do anything helpful for you.

Thank you! :-)

[...]

> systemd will happily let you customize the environment of that... thing...
> but not your login session.

Fine, I'm happy to be able to ignore environment customization via
systemd because I'd really like to have an
init-distro-display_manager-desktop_manager agnostic way to configure it
(and keep it in my dotfolder, git versioned, etc., etc....)

I'm still investigating...

Thank you! Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

Attachment: signature.asc
Description: PGP signature


Reply to: