Copied out of /afs/athena/astaff/project/olh/Dotfiles by daveg
IMPORTANT NOTE: The information in this document is OUT OF DATE, particularly with respect to the organization of directories for executable files. Do not rely on this document for current information!
Until a new version is ready, we will provide this out-of-date information because it can be useful as a guide to how Athena session configuration is structured. Again, the details are wrong, but the overall process is pretty much the same. In any case, beware!
About this document:
The section Creating New Configuration Files gives a brief explanation of how to create or revise your own customized configuration files, or "dotfiles." Filenames for dotfiles begin with a period (.). These files are normally hidden. In order to list the dotfiles in your directory, issue the command ls -a . If you want guidelines to customizing a new session, without reviewing the explanations of each phase, go to the section How to Make Some Particular Customizations.
------------------ | Run setup file | ------------------This first command run by /usr/athena/lib/init/xsession simply calls the user file ~/.cshrc (unless you have deleted it accidentally, or on purpose, which is not recommended). If you examine ~/.cshrc, you will find that it sleeps for a few seconds during initialization. This causes initialization to run faster, rather than slower; you may find this technique useful in your .startup.x file.
~/.cshrc /usr/athena/lib/init/cshrc ~/.environment ~/.path ~/.cshrc.mineIf you select a "window" session using the Ignore your customizations option, only the system file /usr/athena/lib/init/cshrc is used, so user adjustments are not taken into account.
----------------------------------- | ~/.cshrc | | | | Set up global/shell environment | -----------------------------------(This file is bypassed if this is an Ignore your customizations session.)
This file calls the system file /usr/athena/lib/init/cshrc. In addition to being called by the system xsession file, the ~/.cshrc file is also called every time a new C shell process is started (i.e., whenever the command csh is run, as when a new xterm is started).
Although it simply calls another file, the ~/.cshrc file is necessary because standard UNIX expects to find a shell initialization file actually in the user's home directory. The standard version of ~/.cshrc that is given to all new users is in /usr/prototype_user/.cshrc.
Warning: Do not make changes to ~/.cshrc. Make changes to the C shell initialization through the ~/.environment, ~/.path, and ~/.cshrc.mine files.
------------------------------ | /usr/athena/lib/init/cshrc | ------------------------------This file embodies two major steps in the session setup:
1. Environmental setup -- sets UNIX environmental variables, command search path, etc. This step is usually performed only once in a session.
2. Shell setup -- sets C shell variables/aliases, command prompt, etc. This step is performed every time a new C shell process is started (for example, every time a new xterm is started).
----------------------------------------------------------- | Set up global environment (env. variables, default file | | protection) | -----------------------------------------------------------This step involves several activities (any of these settings can be overridden by user settings in the ~/.environment file, described in the next step):
1. Three shell variables are set so thay can be used later to set the standard path and manual page path (and so that users can refer to them in their own path specifications -- see the ~/.path file):
set athena_path=( /srvd/patch /usr/athena/bin /bin/athena \ /usr/bin/X11 /usr/new /usr/ucb \ /bin /usr/bin /usr/ibm /usr/andrew/bin ) set bindir=${hosttype}bin set athena_manpath=/usr/athena/man:/usr/manThe first command above creates the shell variable athena_path, which identifies all the directories that contain standard Athena programs.
The second command creates the shell variable bindir, which identifies the standard name for directories containing programs for the particular type of workstation you are using. In each new session, bindir takes the value appropriate to the workstation you are logged into:
vaxbin (for VAXstations) decmipsbin (for DECstations) rtbin (for IBM RTs) rsaixbin (for IBM RS/6000s)The third command sets the default places in which the man command will look for manual pages.
Note that these paths are not yet set; the path used at this stage of initialization is a less full path specification set by xlogin. The complete command search path is set at a later stage; see "Set up search path," below.
2. Standard Athena global settings are made, as follows:
umask 077 limit coredumpsize 0 setenv MORE -csd setenv EDITOR emacs setenv VISUAL emacs setenv RSUSERHOME ~/rsuserhome setenv MANPATH $athena_manpath if (! $?WINDOW_MANAGER) setenv WINDOW_MANAGER mwmThese commands produce the following effects:
umask 077 sets the default file protection such that only the user can read or write any files he or she creates in the session.
limit coredumpsize 0 prevents coredumps from being created on the system, to help keep users' below their quota of 1.2MB. If you are doing programming, you will probably want to change the coredumpsize value.
setenv MORE -csd sets the default behaviour of the more command, such that it will:
setenv RSUSERHOME ~/rsuserhome sets the default "home" directory, if you are an RS/1 user, to be ~/rsuserhome (the directory does not have to exist otherwise).
setenv MANPATH $athena_manpath sets the standard Athena path as the location for the man command to find manual pages.
if (! $?WINDOW_MANAGER) setenv WINDOW_MANAGER mwm sets the default window manager to be mwm (the window manager is started in the "Startup" phase; see the section, Window-Oriented Device Setup).
---------------------------------------------------------------- | Make user adjustments to global environment (if file exists | ---------------------------------------------------------------- ----------------------------------------------------------- | ~/.environment | | | | Global setup (set environmental variables, protections; | | attach lockers, etc.) | -----------------------------------------------------------(This step is bypassed if this is an Ignore your customizations session.)
You can adjust the global environment created at the beginning of a session. Using an editor (emacs or ez), create the file ~/.environment, containing the commands to be executed. In this file you can:
setenv EDITOR ezcomp # set ez as the default editor setenv COURSEDIR ~/6.030 # set environment variable set skip_initial_xterm # don't display standard xterm window attach sipb games # access sipb and games lockersDo not include any commands that require a response from the user. At this stage of initialization, no window is in place where you can respond with the keyboard or mouse (a command requiring dialog with the user would cause the session to hang).
---------------------------------------------------------------- | (Back in /usr/athena/lib/init/cshrc) | | | | Set up search path (use user-specified path, if file exists; | | otherwise, use standard Athena path) | ----------------------------------------------------------------In this step, the complete command search path is set (an abbreviated path was set by xlogin in order to function, but now a fuller path is set).
If no user file ~/.path exists, or if this is an Ignore your customizations session, the system uses the following default path:
set path=($HOME/$bindir $athena_path .)This default path includes:
--------------------------- | ~/.path | | | | Set command search path | ---------------------------(This file is bypassed if this is an Ignore your customizations session.)
The contents of ~/.path must provide a complete path specification to be used instead of the standard path setting. This file lets you set the path once for the entire session, rather than having the system set the path, then you later reset it to include your own command directories once you attach the appropriate lockers. (If you have to attach lockers later in the session initialization sequence -- e.g., in ~/startup.X rather than ~/.environment -- but you want to include directories from these lockers in your path, include the path specification in the ~/.path file and issue a rehash command after you attach the lockers.)
The contents of ~/.path are simply a command setting the path; for example:
set path=( /mit/sipb/$bindir /mit/games/$bindir ~/$bindir $athena_path . )You must include $athena_path in order to get the standard Athena commands. Also, the period by itself, before the closing parenthesis, tells the system to look for commands in your current directory. The shell variables bindir and athena_path were defined earlier in the initialization sequence.
------------------------------------------------------ | (Back in /usr/athena/lib/init/cshrc) | | | | Set up shell environment (shell variables/aliases, | | command prompt, etc.) | ------------------------------------------------------The activities of this step set up the standard C Shell environment. Any of these settings can be overridden in the ~/.cshrc.mine file (described later). For details on the C Shell, type man csh at the athena% prompt.
1. Standard C Shell initializations are made:
set noclobberThis statement sets up the shell so that you will not accidentally overwrite existing files when issuing commands that use redirection to create new files (e.g., cat > foo).
If the shell is an interactive shell, where the user is presented with a prompt and can engage in an interactive dialogue, the following initializations are also made (terminal initialization depends on the type of workstation you are using):
stty dec set prompt = "athena% " set history = 20 set cdpath = (~) set interactiveThese commands produce the following effects:
stty dec sets the system to respond to DEC-style terminal control characters (e.g., C-u will erase to the beginning of the line, DELETE will backup one character, etc.). Note: Terminal initialization varies slightly, depending on the workstation.
set prompt = "athena% " sets the default prompt to be athena%.
set history = 20 tells the system to keep a record of the last 20 commands.
set cdpath = (~) sets the default directory to try when the cd command fails to find a specified directory directly to be the user's home directory.
set interactive creates the shell variable interactive (for compatibility with earlier Athena releases).
2. Standard C Shell aliases are set. Aliases are shorthand names for frequently used, but long, commands. You can set your own aliases in the ~/.cshrc.mine file (see below). For more details, type man alias and man csh. Some default aliases are as follows:
alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q - \!*`' alias mail 'Mail' alias Mail 'more /usr/prototype_user/README.mail ; echo \!* > /dev/null' alias xresize 'set noglob; eval `resize` || unset noglob' if ($?XSESSION) then if ("$XSESSION" == " ") then alias logout 'exit && end_session' else alias logout 'exit && kill -HUP $XSESSION' endif endif alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) \ setenv \!:1 ${\!:1}:\!:2' alias add 'set dir = `attach -p \!*` && \\ if ("$PATH" =~ *"$dir/$bindir"*) rehash && \\ extend PATH $dir/$bindir && \\ extend MANPATH $dir/man && \\ unset dir' alias renew 'kinit $USER && fsid - a && zctl load /dev/null'These aliases do the following:
--------------------------------------------------------------- | Make user adjustments to shell environment (if file exists) | --------------------------------------------------------------- --------------------------------------------------- | ~/.cshrc.mine | | | | Shell setup (set shell variables/aliases, etc.) | ---------------------------------------------------(This step is bypassed if this is an Ignore your customizations session.)
You can adjust the shell environment that is created for every new C Shell. Using an editor (emacs or ez), create the file ~/.cshrc.mine. In this file you can:
Here is a sample ~/.cshrc.mine file:
set prompt = "HI THERE% " # creates customized prompt alias rm 'delete' # have rm actually call delete set lineedit # can use arrowkeys to go to previous and next commandsNote: In most circumstances, do not include any commands that require a response from the user. At this stage of initialization, no window is in place where you can respond with the keyboard or mouse (a command requiring dialog with the user would cause the session to hang). You may be able to embed a dialogue in some conditional loop, but be very careful.
------------------------------------------------ | (Back in /usr/athena/lib/init/xsession) | | | | Make user adjustments to standard X settings | | (if user file exists) | ------------------------------------------------ ------------------- | ~/.Xresources | | | | User X settings | -------------------(This step is bypassed if this is an Ignore your customizations session.)
In this step, the system checks for the existence of a user file named ~/.Xresources. If the file exists, the following command is issued:
xrdb -merge ~/.XresourcesThe ~/.Xresources file (which supersedes the ~/.Xdefaults file of earlier releases) identifies adjustments the user wants to make to the default characteristics for X windows. The xrdb command incorporates these user settings into the general X resources database before the system starts up the window manager (see the section, Window-Oriented Startup).
Note that the system file does not actually execute the ~/.Xresources file in the same way it executes other configuration files (~/.environment, for example). In other words, control of the session never actually gets handed over to the ~/.Xresources file in the same way as other files.
------------------------------------------------------------------- | (Back in /usr/athena/lib/init/xsession) | | | | Start window manager, making user adjustments to standard wm | | settings (if user file exists) | ------------------------------------------------------------------- --------------------- | ~/.mwmrc | | | | User mwm settings | ---------------------In this step, the X window manager is started. The window manager is set in the WINDOW_MANAGER environmental variable, set above. Currently, the system uses the mwm window manager as the default. You can override the default by setting WINDOW_MANAGER to the one you want in your ~/.environment file.
As with ~/.Xresources, the ~/.mwmrc file is a configuration file that identifies adjustments the user wants to make to some other program (in this case, mwm). For another window manager, another configuration file would be used (e.g., ~/.twmrc for the twm window manager). Note: The formats between window managers' configuration files are generally incompatible.
The ~/.mwmrc file is not even explicitly referred to in the system session file, but is checked by the mwm process itself. Again, control of the session never actually gets handed over to the ~/.mwmrc file in the same way as other files.
------------------------------------------- | (Back in /usr/athena/lib/init/xsession) | | | | Start the Athena Dashboard | -------------------------------------------The first phase of a "window" session creates the Athena Dashboard, dash. If you do not want the Dashboard, include the following statement in your ~/.environment file:
set skip_dash
------------------------------------------- | Display "Logout" button | -------------------------------------------In this step, the system session file calls the xlogout program.
The standard window-oriented application, xlogout, displays a button labeled "Logout" in the bottom-right-hand corner of the screen. When you click on the button, the application displays a dialogue box asking "Do you really want to terminate your session?" If you agree to quit the session, xlogout terminates it (see the section, Window-Oriented Logout).
To override the display of the Logout button (you can still logout by typing logout at the prompt in an xterm window), include the following statement in your ~/.environment file:
set skip_xlogout
------------------------------------------- | Start initial xterm | -------------------------------------------The next phase of a "window" session creates an initial xterm window so that you can start interacting with the system. The standard window is placed in the upper-left-hand corner of the screen, just below the dash menu bar (about 30 pixels down from the top edge of the screen).
You cannot directly change the placement (or other characteristics) of the initial xterm window. To create an initial xterm with characteristics other than the default, follow these two steps:
1. In your ~/.environment file, include the following statement to bypass the initial xterm provided by the system:
set skip_initial_xterm(You do this also if you do not want the original xterm window to appear at all.)
2. In your ~/.startup.X file create an xterm of your own, specifying placement and other characteristics (see below).
Warning: You should not bypass the initial system xterm call unless you call an xterm window of your own in your ~/.startup.X file, or if you call a program that does not require an xterm window. If you accidentally exit all of your xterm windows in a session, you can create a new one through dash; go to the Special menu and click on New xterm window.
------------------------------------------------------------------- | Run standard startup activities (check mail, start zephyr, etc.) | -------------------------------------------------------------------In this step, the system runs standard activities that most users want automatically:
(zwgc && get_message -new -zephyr) from -t -n (olc who &) >& /dev/nullThis sequence of commands:
set skip_x_startup
---------------------------------------------------------- | Run user-specified startup activities (if file exists) | ---------------------------------------------------------- ------------------------------------------ | ~/.startup.X | | | | Startup activities for window sessions | | (e.g., xclock, xload, etc.) | ------------------------------------------Do not do this if you have chosen an Ignore your customizations session, or if you select a terminal-type login.
In this step, the system session file runs all of the commands contained in the user file ~/.startup.X. Here is where you can start up window activities such as xclock, xload, emacs, xmh, etc. For example, the following ~/.startup.X file specifies placement of three windows:
xterm -geometry 80x20+0+25 & # upper left, below dash emacs -geometry 80x50+500+20 & # right of center xclock -geometry 80x80+0-0 & # bottom leftNote: Put an ampersand, &, after each command in the ~/.startup.X file so that it will run in the background. If you do not, the system session file may never get past this step, which can cause problems with the session. For example, if you like to run xclock throughout a session, but you call xclock without an ampersand, the system session file will stop your login process while it waits for xclock to finish.
-------------------------------- | User interacts with system | | ... | | User issues "logout" command | --------------------------------Now you are logged in and your interactive session can begin in earnest. When you want to terminate the session, you have two options:
--------------------------------------------------------- | Run user-specified logout activities (if file exists) | --------------------------------------------------------- --------------------- | ~/.logout | | | | Logout activities | ---------------------(This step is bypassed if this is an Ignore your customizations session.)
To have the system run any special post-session activities, include the appropriate commands in the file ~/.logout. For example:
cp ~/RMAIL ~/RMAIL.save #back up your mailboxDo not include commands that rely on the existence of xterm windows (e.g., a dialogue, or a clear command).
If you have a file named ~/.hushlogin (it can be an empty file), then the system will not echo status messages about initialization (i.e., messages such as "Setting up environment..." will not be echoed to your screen during startup). This speeds up tty-session initialization.
---------------------------------- | ~/.login | | | | Run tty activities environment | ----------------------------------This file calls the system file /usr/athena/lib/init/login. Although it simply calls another file, the ~/.login file is necessary because standard UNIX expects to find a login initialization file in your home directory.
Warning: Do not make changes to ~/.login. Make changes to the tty initialization through the ~/.environment and ~/.startup.tty files.
The standard version of ~/.login that is given to all new users is found in /usr/prototype_user/.login.
------------------------------ | /usr/athena/lib/init/login | ------------------------------This file embodies two major steps in the session setup:
---------------------------------------------- | Make temporary home directory if necessary | ----------------------------------------------In this step, the system checks whether you have access to your home directory. If not, the system offers to create a temporary local directory, warning that work in it may get lost. You can terminate the session at this stage by answering the system question to this effect.
------------------------------------------------------------- | Set up tty device characteristics (e.g., vt100 emulation) | -------------------------------------------------------------In this step, the system does some setup activity related to the particular device being emulated, and prompts for the DISPLAY variable if the session originated by an rlogin or telnet.
------------------------------------------------------------------- | Run standard startup activities (check mail, start zephyr, etc.) | -------------------------------------------------------------------In this step, the system runs standard activities that most users want to have run automatically:
set ignoreeof # ^D won't log you out zwgc # tries to start a zephyr client from -t -n # checks for new mail (olc who &) >& /dev/null # if you have a question pending in olc, notifies olc that you have logged inTo override any one of these steps, you must override the whole set, then include the ones you want to run in your ~/.startup.tty file (see the next step). To override the default set of steps, include the following statement in your ~/.environment file:
set skip_tty_startup
---------------------------------------------------------- | Run user-specified startup activities (if file exists) | ---------------------------------------------------------- --------------------------------------- | ~/.startup.tty | | | | Startup activities for tty sessions | | (e.g., inc, zwgc -ttymode, etc.) | ---------------------------------------In this step, the system session file runs all of the commands contained in the user file ~/.startup.tty. For example, ~/.startup.tty might contain:
emacs & # choose emacs as the text editor inc # incorporate new mailNote: In the ~/.startup.tty file, run in the background any command that will not exit quickly. To run a command in the background, put an ampersand, &, after it. In the examples above, this is not necessary with inc because it will exit quickly. It is necessary with emacs; otherwise, the login process will stop while it waits for emacs to exit.
-------------------------------- | User interacts with system | | ... | | User issues "logout" command | --------------------------------Now you are logged in and your interactive session can begin. When you want to terminate the session, type logout at the shell prompt.
Note: When you log in for your first-ever Athena tty session, type the following command at the prompt:
athena% zctl set fallback trueYou need issue this command only once in your Athena tty-session career. It sets the fallback variable so that Zephyr runs in tty mode, by default, when you log into a tty session.
--------------------------------------------------------- | Run user-specified logout activities (if file exists) | --------------------------------------------------------- --------------------- | ~/.logout | | | | Logout activities | ---------------------To have the system run any special post-session activities, you can include commands in the file ~/.logout. Remember that the commands in this file will also be used for "window" session logout. For example:
cp ~/RMAIL ~/RMAIL.save # back up your mailboxDo not include commands that rely on the existence of xterm windows (e.g., a dialogue, or a clear command) in a "window" session.
You create each customization file using an editor such as ez or emacs. Place each file in your home directory and give it the appropriate name; remember to start the name with a "dot." for example, .environment. (To list the "dot files" in your directory, issue the ls -a command at the athena% prompt.)
Most customization files are just plain text files with a valid command on each line (~/.Xresources and ~/.mwmrc have more specific formats). Also, most configuration files do not have to be executable files (in terms of file protection), nor do they have to be fully valid shell scripts (the commands they execute, however, must be valid C shell commands). You can even include comments in configuration files by using a pound sign (#); any characters on the same line following the pound sign are treated as a comment (this, however, is not true for ~/.Xresources).
~/.hushlogin ~/.cshrc.mine ~/.environment ~/.path ~/.Xresources ~/.mwmrc (etc.) ~/.startup.X ~/.startup.tty ~/.logoutOther common dot files are listed below.
~/.emacs ~/.anyone ~/.klogin ~/.ispell.words ~/.meetings ~/.message_times ~/.newsrc ~/.plan ~/.zephyr.subs ~/.zephyr.vars ~/.zwgc.desc ~/.saber.initWarning: Do not change the three files listed below. Should you do so anyway, it is at your own risk. If you change them, Athena cannot guarantee or support their session activity for you.
~/.xsession ~/.cshrc ~/.login