.profile is not sourced in Debian Wheezy LXDE

But shouldn't it have been sourced during the graphical login?

There's a minor debate about that on which some graphical logins take an unusual stance...

I add $HOME/bin to $PATH from ~/.profile. However, it seems it is not sourced during login. I use a login manager - lxdm I think

Correct. Most DM's do read ~/.profile when you log in. However, they must do this explicitly, since ~/.profile is traditionally sourced by login shells and a DM (GUI login) is not a shell!

Which is the justification I have seen from the lightdm people for not sourcing ~/.profile explicitly -- because a DM is not a shell.

You can source ~/.profile yourself from ~/.xsession -- see here.


Agree with @goldilocks mostely. Just want to add that the script to source ~/.profile is ~/.xsessionrc, instead of ~/.xsession.

Here is the rationale:

qxu@debian:/etc/X11/Xsession.d$ cat 40x11-common_xsessionrc
# This file is sourced by Xsession(5), not executed.

#Source user defined xsessionrc (locales and other environment variables)
if [ -r "$USERXSESSIONRC" ]; then
  . "$USERXSESSIONRC"
fi

qxu@debian:/etc/X11$ grep USERXSESSIONRC Xsession
USERXSESSIONRC=$HOME/.xsessionrc

If bash is your login shell, then it will try ~/.bash_profile, ~/.bash_login and ~/.profile in this order. It will however stop at the first one it finds.

If your ~/.profile is not sourced, then it means you have either one of the other two (possibly both) in your HOME directory. You should check which one, then place the new PATH statement in the first one.

Tags:

Profile

Lxde