Re: xdm source .bash_profile
Matus UHLAR - fantomas wrote:
>On 24.06.06 00:00, Pavlos Parissis wrote:
>> I have been trying to make my X to source the .bash_profile in order to
>> set my $PATH variable.
>> Any idea where should I look to get this done?
>Some time ago I solved this problem by sourcing /etc/profile and
>$HOME/.profile from /etc/X11/xdm/Xsession (I was using xdm).
I have the following snippet as /etc/X11/Xsession.d/75local-profile :
# Source a users .profile, etc
PROFILES="/etc/profile $HOME/.profile /etc/xprofile $HOME/.xprofile"
for PROFILE in $PROFILES ; do
[ -f "$PROFILE" ] && . "$PROFILE"
I added the xprofile bit just in case there was going to be something
that I may want set up only when logging in via X. So far I dont have
such a file (3 years laters) so it's probably unnecessary.
>the $HOME/.profile is being sourced by bourne-compatible shells at user
>login and should contain seting of environment variables like $PATH.
That's an important point, as /etc/X11/Xsession runs under /bin/sh, not
necessarily bash so you should make sure you split up your bourne shell
compatible init and your bash (or other shell) specific init and possibly
source ~/.profile from your .bash_profile.