next up previous contents index
Next: Future Plans Up: Customizing VMD Sessions Previous: Environment Variables

Startup Files

Core Script Files

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 ???.)

User Script Files

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.

.vmd_init File

 

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:

Here is an example of an initialization file:

display = win
title = on
scrheight = 6.0
scrdist = -2.0
scrpos  = 596 190
scrsize = 669 834

.vmdrc File

 

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



next up previous contents index
Next: Future Plans Up: Customizing VMD Sessions Previous: Environment Variables



Andrew Dalke
Tue May 14 16:49:45 CDT 1996