Re: A strange experiment: where to set a X-session-wide environment?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Roberto C. Sánchez wrote:
> On Fri, May 18, 2007 at 08:51:42PM +0800, Wei Chen wrote:
>> I have done a small experiment and got a strange result.
>> 1. write `export SOME_VARIABLE=something' in .bash_profile
>> 2. logout kde and login again
>> 3. write a simple script (see following) to test whether the environment
>> is set. I clicked the script file directly in konqueror to run it and
>> the script used `/bin/csh` in order not to open a bash shell. (I thought
>> even in somewhere a bash shell was involved, it should not be a login
>> shell so .bash_profile should not be sourced in this step)
>>
>> #!/bin/csh
>> kdialog --msgbox "The variable is $SOME_VARIABLE"
>>
>> I didn't expect it to work since I didn't think .bash_profile should
>> have been sourced anywhere in the experiment. However I got the value of
>> the variable with no problem.
>>
>> Would anyone please tell me:
>> 1. where was the .bash_profile file sourced?
>
> Your display manager did this for you:
>
> |-gdm---gdm-+-Xorg
> | `-sh---WindowMaker---WindowMaker-+-firefox-bin---8*[{firefox-b+
> | |-gnome-terminal-+-bash---mut+
> | | |-bash---pst+
> | | |-gnome-pty-+
> | | `-{gnome-ter+
>
>> 2. what is the correct place if I want to set a X-session-wide environment?
>>
> I seems like you already have accomplished that. However, if you mean
> the Xsession without the parent shell, then probably
> /etc/X11/Xsession.d/ or /etc/X11/Xsession. Of course, if you launch an
> xterm or other terminal emulator from your Xsession then it will get the
> variable.
>
> Regards,
>
> -Roberto
>
Thank you for your information. I just looked into kdm and found that
`.bash_profile' was sourced there in /etc/kde3/kdm/Xsession. Then I
think it could be all right to put variables in `.bash_profile' file.
Thank you.
- --
Cheers,
Wei Chen
http://www.acplex.com/people/wchen/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGTofoCIqXQV6BF28RAhqvAKCz+zJNTSeH76ffQjumdjmYjoGYYgCgk7I0
cP9yYjoCOhMYj3eBF4LGOto=
=oW/Z
-----END PGP SIGNATURE-----
Reply to: