In the following, the value of $VMDDIR is the vmd installation directory. During the original installation this is the value of INSTALLLIBDIR. It can also be found by looking at the first few lines of the vmd startup script ( head `which vmd`) or by starting VMD and using the command set env(VMDDIR).
As mentioned elsewhere, VMD uses the Tcl interpreter with two language extensions, TclX and Tcl-DP. Each of these three packages reads Tcl scripts at initialization, which are contained in VMD \ distribution; with a different directory for each package. The locations of the directories is determined by the environment variables defined in the vmd script. In order they are TCL_LIBRARY, TCLX_LIBRARY, and DP_LIBRARY, which are set in the vmd startup scrip to $VMDDIR/scripts/tcl, $VMDDIR/scripts/tclX, and $VMDDIR/scripts/dp, repectively. In addition, VMD has its own directory of core Tcl routines.
The most important of these is $VMDDIR/scripts/vmd/vmdinit.tcl. This file sets up the basic Tcl initialization commands including the commands that catch C interrupts, define some environment variables, and add the vmd script directory to the Tcl autoindex path. Most of the other files are referenced through the autopath (right name???).
There are a few non-Tcl scripts in this directory. Currently these are perl scripts used for the urlload command and web client startup. (See the appropriate sections ???.)
Two user configuration files are available: an initialization file .vmd_init, and a run-time command file .vmdrc with a list of initial VMD text commands to process. These files may be changed to customize individual user's initial screen appearance and to set the proper display characteristics for displaying in stereo. If they do not exist, default values are used.
This file is used to define several configuration variables which must be set before several key objects (eg., the display device) can be created. (This is actually a limitation of the VMD implementation - future versions will not use this file.) Thus this is the first file read by VMD ; before even the vmdinit.tcl file. VMD searches for this file in three locations; $VMDDIR/vmd_init, $HOME/vmd_init, and ./vmd_init. Each copy of the file found will be read in and processed in that order. This allows the administrator to establish a complete set of default values for all users, and then for each user to selectively change the settings required without having to set ALL parameters.
The lines in the initialization file should be either blank lines, comment lines(beginning with the # character), or parameter setting lines of the form: <keyword> = <value>
with any amount of whitespace allowed before and after the equal sign. The possible keywords that may be entered here are:
The name (including complete path) of the babel program executable, which is used to convert various molecular file formats to PDB files which may be read by VMD . See ???. This parameter should not be used; instead, use ???
The type of display device which VMD should use initially. This can be set to either WIN, CAVE, or TEXT. By default, this is WIN. It can be overridden with the -dispdev command line option.
The name of the HTML browser which should be used to display HTML files (such as the VMD on-line help file). Typical examples are Mosaic or Netscape; by default this is Mosaic.
The distance, in `world' coordinates, from the origin to the display screen. If this is zero, the origin of the coordinate system in which molecules are drawn coincides with the center of the display. If it is < 0, the origin is located between the viewer and the screen, while if it is > 0, the screen is located closer to the viewer than the origin. A value < 0 puts any stereo image in front of the screen, aiding the three-dimensionaleffect; a value > 0 results in a stereo image that is behind the screen, a less dramatic (but easier to see, for some people) stereo effect when stereo display is in effect. Figure 3.17 describes the relationship between this parameter and the world coordinate space.
This parameter, with SCRDIST, defines the size and distance of the display screen. SCRHEIGHT is the default value for the screen height, which is the vertical size of the display screen in `world' coordinates. Each molecule is initially scaled and translated to fit within a 2 x 2 x 2 box centered at the origin; so the height of the screen helps determine how large the molecule appears initially. If VMD is being displayed on a workstation monitor only, it is best not to change this value from the default setting. This parameter is used mainly to configure the VMD display to the dimensions and position of a large-screen display, such as a projector, that may be being used as a stereo display. As for SCRDIST, figure 3.17 describes the relationship between this parameter and the world coordinate space.
The position of the lower-left corner of the window used to display images, if the display type is WIN. Both xpos and ypos are in pixels. If they are not specified, and are not given as command-line options, the window will have to be interactively placed via the mouse.
The size of the window used to display images, if the display type is WIN. Both xpos and ypos are in pixels. If they are not specified, and are not given as command-line options, the window will have to be interactively sized via the mouse.
A flag indicating whether to display the VMD title in the main display when the program starts. This can have the value of ON or OFF. By default, TITLE is set to be ON. If the title is turned on, it will remain until displayed until a molecule is loaded, after which it will be hidden from view. This can also be set with the command line option -nt.
Here is an example of an initialization file:
display = win title = on scrheight = 6.0 scrdist = -2.0 scrpos = 596 190 scrsize = 669 834
After everything is intialize , VMD reads the startup file using the equivalent of the command play .vmdrc. This file contains text commands for VMD to execute just as if they had been entered at the VMD text console command prompt. The file can contain any number of commands, including blank lines and comment lines (which begin with the # character). If an error is encountered while reading this file, the command in error is skipped and processing of the file continues.
VMD searches for this file in three locations; ./.vmdrc, $HOME/.vmdrc and $VMDDIR/.vmdrc. Only the first file found will be read in and processed.
??? Idea is to refer to place for script -- go to new ug_user_scripts.tex file ??? See chapter for a description of all the VMD text commands which may be put in this file. Also, section discusses how to put commands into the .vmdrc file to customize the behavior of the popup menu and hot keys.
Here is an example of a startup file:
# add personalized keyboard shortcuts user add key E echo on user add key e echo off user add key g display reset user add key A stage location bottom user add key m mol list # position the stage and axes axes location lowerleft stage location off # position and turn on menus menu main move 5 196 menu display move 386 90 menu animate move 124 7 menu edit move 125 196 menu graphics move 5 455 menu files move 5 496 menu mol move 5 745 menu main on # start the scene a-rockin' rock y by 1