On Fri, May 06, 2022 at 02:30:59PM +0200, Giovanni Biscuolo wrote: > On my laptop, inside LXTerminal: > > systemd---gdm3---gdm-session-wor---gdm-x-session---lxsession---lxpanel---lxterminal---bash---pstree
Aha. It's a (grand)child of lxsession, just as with David's. > 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" > No , because in my ~/.xsessionrc (and only there) I have this variable: > > export XSESSION_WAS_HERE="Yes" > > 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 OK. Then it sounds like something in between the Xsession and the shell is indeed overwriting that XDG_DATA_DIRS variable. According to your pstree output, those processes include lxsession, lxpanel and lxterminal. You could start with those. Of course, there could be other processes that are not shown, because they're exec'ed out of the picture. Remember, one of the tools available to you is looking at the initial environment of a process, either by using ps with the "e" option, or by reading the /proc/PID/environ file. The latter is NUL-delimited, so you'd want something like this: unicorn:~$ tr '\0' '\n' < /proc/$$/environ | head -n5 SHELL=/bin/bash QT_ACCESSIBILITY=1 LESS=-X QMAILSHOST=wooledge.org QMAILHOST=wooledge.org I find that a lot more useful than ps e. Of course in your case you wouldn't use |head, but probably |grep XDG_DATA_DIRS. If you see the desired variable value in, say, lxpanel but not in lxterminal, then you have a pretty good idea of where the overwrite occurred.