Creating User Specific Configurations

Some configurations can be customized for individual users. Most of these settings relate to user-level programs, such as window managers, text editors, and web browsers. These configurations almost invariably reside in files or directories in the users' home directories, typically named after the program in question, but with a dot (.) at the start of the name to hide it from view unless you use the -a option to Is. For instance, the configuration file for the NEdit editor is -/.nedit. Most of these files contain highly application-specific options, so you must consult the programs' documentation to learn more about them. Some of these programs also use system-wide defaults, often stored in /etc. These defaults may be copied to the user-specific files or may provide defaults that the user-specific files may override.

Two classes of user configuration files are particularly important. The first is shell configuration files, such as -/.bashrc. Chapter 4 covers these files in more detail. They are essentially just shell scripts. Typically, you use them to set environment variables and aliases.

Another type of important configuration file is an X startup file. The most common of these files are listed here:

~/.xinitrc X uses this file when you type startx from a text-mode login.

~/.xsession The X Display Manager (XDM) XDMCP server uses this file. The KDE Display Manager (KDM) and GNOME Display Manager (GDM) XDMCP servers may also use this file if you select an appropriate login option.

~/.vnc/xstartup This file is the Virtual Network Computing (VNC) X startup file, which is used by the VNC server and described in Chapter 26, "Providing Remote Login Access."

These files are usually bash scripts, and they typically launch programs the user wants to run when first logging in. The most important line in these files is usually the last line or at least something very near to the last line. This line launches the X window manager, which places decorative and functional borders around windows, including the title bar and the borders that enable you to resize windows. Instead of a call to a window manager, the script may launch a desktop environment, which includes a window manager and other helpful tools. Window managers and desktop environments are both described in more detail in Chapter 6, "Getting the Most from a Desktop Environment."

X startup scripts may include calls to other programs beyond window managers or desktop environments. For instance, if you want to launch an xterm when you log in, you would include a line that calls this program prior to the window manager call. Such calls typically end in ampersands (&) to launch the program in the background; otherwise, the script will stop executing until the program terminates. The call to the window manager, by contrast, lacks this feature; this way, the script doesn't continue executing until you exit from the window manager. After that point, X shuts down or your XDMCP server's login window reappears. On occasion, an X login script includes a few lines after the window manager call. These lines may clean up temporary files, play a logout sound, or what have you. Listing 9.2 shows a typical X login file. This file launches an xterm and plays a login sound before launching the IceWM window manager. (IceWM manages the xterm, even though the xterm was launched first.) When the user exits from IceWM, the system plays a logout sound.

Listing 9.2: Typical X Login File

play ~/sounds/login.wav & icewm play ~/sounds/logout.wav &

Team LIB

This document was created by an unregistered ChmMagic, please go to http:/

0 0

Post a comment