##########################################################################
# file:        SessionEnvironmentVariables
# description: Environment variable setup common to all session scripts.
#
# This file is to be sourced in all session scripts in the
# /etc/X11/gdm/Sessions directory. It must be sourced, not executed as a
# child process, for the environment variables to initialize properly. 
#
##########################################################################

# Source the profile functions.
. /IBM/bin/profile.functions

# performance boost change...
#. /etc/rc.d/rc.IBM_NS.env
. /tmp/envvars.sh


for envfile in "/etc/environment" "/tmp/environment" 
do
   if [ -r "$envfile" ]; then
      set -a
      . $envfile
      set +a
   fi
done

# Export the keyboard type for IBM emulators.
if [ -r /etc/sysconfig/keyboard ]; then
   . /etc/sysconfig/keyboard
   export KEYTABLE
fi

IBMSetupEnvPrefs=`profile_file IBMSetupEnvPrefs`
if [ -r "$IBMSetupEnvPrefs" ]; then
   set -a
   . $IBMSetupEnvPrefs
   set +a
fi

# Set the PROFILE_USER environment variable.
PROFILE_USER=$USER
if [ -f /tmp/profile/machine/IBMSetupLogin ]; then
   . /tmp/profile/machine/IBMSetupLogin
   if [ "$AutomaticLoginEnable" = "true" ]; then
      if [ -n "$AutomaticLoginProfileUser" ]; then
         PROFILE_USER=$AutomaticLoginProfileUser
      fi
   fi
fi
export PROFILE_USER

# Set the IBM_EMUL_SYS_DEFAULT_DIR for emulator system defaults.
export IBM_EMUL_SYS_DEFAULT_DIR=/tmp/profile/user


