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

A strange experiment: where to set a X-session-wide environment?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I want to export an environment variable to the whole X session for a
user in my system. Where should the environment variable be set? Is it
OK if I set it in `.bash_profile'? (I am using kdm + kde.)

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?
2. what is the correct place if I want to set a X-session-wide environment?

Thank you in advance.

- --
Cheers,

Wei Chen
http://www.acplex.com/people/wchen/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGTaFeCIqXQV6BF28RAnOoAJ4zEJptyABULoQZJc0Drc4+BJKsBQCfd+Ag
IeCVgkURvUbmoOtLr9ldRMY=
=Ld9z
-----END PGP SIGNATURE-----



Reply to: