The QSmack frontend config file allows the user to customize the look and feel of the frontend tool. The frontend script reads in a config file in two ways. First, a command line argument can be given to the script which will be interpreted as the name of the config file to read in. As in:qsmackfe.tcl qsmack.cfg.highres
The second way is system specific. The QSmack frontend will look in some default places for specially named files on both Mac and UNIX platforms.
Here is an example frontend config file:password: testing123 defaultQSmackServer: machine.that.is.running.qsmack.com:26789 width: 80 historyDepth: 50 saveTextLines: 500 serverWindowHeight: 12 smackWindowHeight: 12 commandWindowHeight: 14 serverPrints: server smackPrints: smack commandPrints: command textFont: -*-courier-medium-r-*-*-12-*-*-*-*-*-*-* infoFont: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-* titleFont: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-* showNum: true showName: true showColors: true showFrags: true showIpaddr: false
The format of the config file is pretty simple and very similar to the format of the config file for the regular QSmack program. The main difference is that this config file must have a colon ':' between the option and its value. Lines beginning with a hash mark ("#") are comments, and blank lines and whitespace are ignored. Config parameters should appear on lines by themselves.
The only parameter that must be specified in the config file is "password". All other parameters will take on default values if they are left out. Here's a description of what the example frontend config file is doing, line by line:
This specifies the password that the frontend will send to the QSmack program when it connects. This should be the same password that you specified in the regular QSmack config file. This parameter must be specified in the config file or the frontend won't be able to connect to QSmack.defaultQSmackServer: machine.that.is.running.qsmack.com:26789
This specifies the QSmack program that the frontend should connect when the program starts. This option is convenient if you only run one server and you only have one QSmack running. The default is not to connect to any QSmack at start up.width: 80
Specifies the minimum width (in characters) of the text windows. The windows may be wider due to the width of the status area. The default is 80 characters.historyDepth: 50
Specifies the number of interactive commands to save in the history list. The default value is 50.saveTextLines: 500
Specifies the number of lines to save in the three output windows. Once the window has this many lines in it, the oldest lines are discarded.serverWindowHeight: 12 smackWindowHeight: 12 commandWindowHeight: 14
Specifies the height (in lines) of the three windows. If the height is set to zero '0', then that window will not be visible at all. For low resolution monitors you may want to set two of the window heights to zero and channel all the messages to one window. See the "serverPrints", "smackPrints", and "commandPrints" options below for details on how to do that. The default height for all three windows is 4 lines.serverPrints: server smackPrints: smack commandPrints: command
With these three options, you can direct the usual output from one window to another. This is useful if your monitor is low resolution and you only have room to display one window. To do this, set the heights of two of the windows to zero and then direct the output from those windows to the window with a non-zero height. This is one possible configuration:serverWindowHeight: 0 smackWindowHeight: 0 commandWindowHeight: 10 serverPrints: command smackPrints: command commandPrints: command
The valid values for these options are "server", "smack", and "command". Any other values will generate errors.textFont: -*-courier-medium-r-*-*-12-*-*-*-*-*-*-* infoFont: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-* titleFont: -*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*
These options set the fonts that the frontend uses in displaying information. The "textFont" is used for the text in the output windows. It is highly advisable to make this a fixed-width font. The "infoFont" is the font used in the player status area. The "titleFont" is the font used for the status area at the top, the window titles, and the command prompt at the bottom. Bold fonts look better for these last two fonts. The default value for all three fonts is the font that Tcl/Tk would choose if you specified no font at all. This is advantageous because Tcl/Tk picks fonts based on the machine that it is running on.
If you select a font that you don't have installed on your system, a default font will be used instead.
You can refer to the "FONT DESCRIPTION" section of the "font.n.html" page that came with your Tk documentation to learn more about describing fonts, but here is a capsule summary. If you are using Tcl8.0/Tk8.0, you can specify the fonts in a more human readable form like "Courier 12" or "Helvetica 14 bold" (leave off the quotes though). The format is family name, followed by size, followed by an optional list of zero or more styles. The possible styles are normal, bold, roman, italic, underline, and overstrike.
Those who use Tcl7.6/Tk4.2 must use the arcane font format shown in the examples above (it will also work under Tcl8.0/Tk8.0). The dashes delimit various fields that describe the font; an asterisk ("*") in a field tells Tk "I don't care; pick something.". In the examples above, we have only bothered to specify family, weight, slant, and size. The complete list of fields is -foundry-family-weight-slant-setwidth-addstyle-pixel-point-resx-resy-spacing-width-charset-encoding. (Whew!) Most of these you won't need to mess with. Helpful tip for those of you using the frontend on an X Windows system (e.g. most Linux systems): the command "xlsfonts" will show the available fonts, in this format.
Obviously the new Tcl8.0/Tk8.0 format is the way to go unless you need to be inhumanly precise about your font specifications. Another reason to upgrade to Tcl8.0/Tk8.0 if you're still mucking around with an older version. :-)showNum: true showName: true showColors: true showFrags: true showIpaddr: false
These options control what fields are displayed in the player info area. The default values are the ones shown above. By default, the IP address is not shown because it tends to make the frontend too wide. If all the options are set to "false", the player info area will not be displayed at all. This may be necessary for people with really low resolution monitors. The only valid values for these options are "true" and "false".