The login box on the terminal is displayed by a program called xdm. When it has verified that you are a valid user of the system from your login and password, it will then set up your environment for the session. It checks to see if there is a .xsession file in your home directory; if there is not, xdm sets up the default environment. If it does find a personal .xsession file xdm executes the commands in this file instead of using the defaults.
An .xsession file is a shell script; you can have a look at an example .xsession file in:![[*]](/home/opencms/tomcat/temp/import_html59792/primer/footnote.png)
/usr/local/X11R6/lib/X11/xdm/Session-Script
or
/usr/local/X11/lib/X11/xdm/Xsession