previous contents up next

Unix for Advanced Users

16. X and Simple X Configuration

16.4. X11 dotfiles - .xinitrc and .xsession

Like many Unix programs, X parses a file of standard Unix commands before starting. This behavior lets you customize X, automatically starting programs you like when you start X, as well as allowing for more complicated actions (like, e.g., killing off all mail-reading processes in the background). The file is treated as a shell script for the shell you are using when you run startx.

The file that is actually read depends on the way the X session is started. For text logins, the file is .xinitrc; for graphical logins, it is .xsession. In either case, the file resides in the home directory of the user logging in. (In the case of a text login, where su may have been used, the home directory is the one corresponding to the real UID of the login shell.)

One important function of the .xsession or .xinitrc is to start the window manager. A window manager is a special X client that provides window "decorations", such as titlebars, and allows the user to move windows around, change their size, and perhaps change them to icons using keyboard or mouse movements. There is a plethora of window managers available, from the relatively modest twm included with all X servers to the ultra-configurable, graphically rich enlightenment. In a typical .xinitrc or .xsession, the window manager is started at the end of the file using exec.

previous contents up next