Re: Inheriting shell environment




Morten:

How do I get my shell environment variables exported to my X
environment when using gdm?

I thought the usual way would be to source the file containing
the environment variables from ~/.Xsession and then gdm would
read that file -- but it seems to have no effect?

I am using Ubuntu, btw.

I assume that you are asking how to set your default environment
variables when logging into gdm2.  Note that the script that starts
your session is the /usr/share/gdm/Xsession script.  Note that it
sources the following files:

/etc/profile
$HOME/.profile
/etc/xprofile
$HOME/.xprofile

So, if you set environment variables in any of the above files,
they will be set properly when you log in.

gdm2 is a little different than some other login programs in that
it does not support setting environment variables for your session
from shell-specific config files ($HOME/.bashrc, $HOME/.cshrc, etc.).
This is done because your login session isn't really a shell.  Each
shell is slightly different and making the login program support
them all (including the odd ones that some people insist on using)
is prone to bugs, problems, and not really maintainable.  gdm2
therefore only supports the $HOME/.profile mechanism for setting
environment variables only.

Brian



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