When you start X, Debian runs some shell scripts that start your window manager and other X clients. By default, a window manager, an xconsole, and an xterm are started for you.
To customize your X startup, the file /etc/X11/config must contain the line allow-user-xsession. If it does not, log in as root and add the line now. Then log back in as yourself and continue the tutorial.
You can see how Debian’s X startup works in the file /etc/X11/ Xsession. Note that you can change the behavior of /etc/X11/Xsession by modifying the file /etc/X11/config, which specifies a few system-wide preferences.
To run the clients of your choice when X starts, you create an executable shell script called .xsession in your home directory.
$ touch ~/.xsession
This creates the file.
$ chmod u+x ~/.xsession
This makes the file executable.
Once .xsession is created, you need to edit it to do something useful with your favorite text editor. You can do anything you want to in this script. However, when the script’s process terminates, X also terminates.
In practical terms, this means that you often end the script with a call to exec. Whatever program you exec will replace the script process with itself, so commands found after the exec line will be ignored. The program you exec will become the new owner of the script process, which means that X will terminate when this new program’s process terminates.