The only lines in most configuration files are:
set TKG_orientation vertical set TKG_nobeep 1If you want to assign a value that contains spaces or tabs, you need to enclose it in double-quotes or in curly-brackets:
set Biff_frm_command "frm markcrim" set Biff_frm_command {frm markcrim}To figure out how special characters and variables are treated inside and outside of double-quotes and braces, consult the (very brief and precise but not an easy read) Tcl man page, avaiable at http://www.sco.com/Technology/tcl/man/tcl_man/Tcl.n.html, or which you probably can read as follows:
man n TclOne common issue is this: If you want to assign one variable a value containing the value of another (unless you are doing something fancy), use double-quotes rather than curly brackets to enclose the new value:
set user markcrim set password getreal set Biff_frm_command "frm $user" set PopImap_command "mypopclientscript.sh $user $password"Another common need is to look at environment variables. You can do this by using the $env array. To set your own variable thehome to the user's home directory, you can do this:
set thehome $env(HOME)(See also Variables that Configure tkgoodstuff.)
Client ClockYou configure a client by setting variables (see the documentation for the particular client for a list of the available variables). It makes no difference where in the configuration file you set client variables (e.g., before or after the Client line).
xdir "xless /var/syslog" {rxvt -T Syslog -sl 400 -e "tail -400 -f /var/syslog"} "rxvt -T Syslog -sl 400 -e \"tail -400 -f /var/syslog\""(The last two are equivalent.)
AddButton Weather -text Weather -unixcmd "rxvt -e telnet downwind.sprl.umich.edu 3000" AddButton News -imagefile /usr/include/X11/bitmaps/news.xbm -unixcmd xrn AddButton XV -imagefile $images/xlogo16 -text "Graphics\nProgram" -unixcmd xvThe first of these buttons displays only the label "Weather", the second displays only an icon, and the third displays both an icon and a (two-line) label.
The AddButton command requires a name for the button as its first argument. The other arguments are all optional:
Note: Tcl substitution is performed on the command string at execution. One thing this allows is inclusion of the current X selection in your unix command. For instance, you can run netscape on the URL currently selected thus:-unixcmd {netscape [string trim[selection get]]}
AddLabelBox NetUtils "Favorite\nNetwork Utilities"
SubStack verticalThis vertical substack starts with the Clock client:
Client ClockThe next element in the substack is a labelbox:
AddLabelBox utilities "Utilities"Then we want three buttons side-by-side, so we start a new substack:
SubStack horizontalThen we define the three buttons with AddButton commands, and close off the substack with:
EndSubStackThis puts us back in the construction of our first (vertical) substack, which so far contains the Clock, the Utilities label, and the substack we have just finished. The last thing in this vertical substack will be another horizontal substack, this one with a colored border four pixels wide:
SubStack horizontal 4 redTwo AddButton commands create the buttons in this bordered substack, which we then end with "EndSubStack". Now we're done with the vertical substack, so we end it with another "EndSubStack". This puts us back in the orignal (horizontal) orientation, outside of all substacks. So the next item we define will go to the right of the big vertical substack we have just defined. This item will be an even bigger vertical substack, which contains a label box, a horizontal substack (which contains a button and a vertical substack of three buttons) and a (gold-bordered) vertical substack, which contains a label box and a horizontal substack (which contains three buttons and a vertical substack containing three buttons). I hope that makes the working of the stacking apparatus clear. If not, play around with it and you'll figure it out. Sep 14, 1995. Mark Crimmins markcrim@umich.edu