In this article I will describe a configuration tool called The Dotfile Generator (TDG for short). TDG is a configuration tool, which configures programs, using X11 widgets like check boxes, entries, pull-down menus etc.
For TDG to configure a given program a module must be made for it. At the moment modules exist for the following programs: Bash, Fvwm1, Fvwm2, Emacs, Tcsh, Rtin and Elm.
The article will describe common use of TDG, so if you do not have it yet, it might be a good idea to download it (It's free!) You may also go to the home page of the Dotfile Generator for further information.
A basic concept in UNIX is that the programs are very configurable. Here is an example from Emacs, which shows this:
What should be done if the user asks to go to the next line at the of a file?Since the program works without a GUI, the standard method for configuring such options is to use a dot-file. In this file, you may program, which method you will use.
There are two logical possibilities:
Instead of implementing only one of the solution the people behind Emacs, have chosen to implement both, and let you decide which one you prefer.
- Insert a blank line, and move to it.
- Beep, to tell the user that there is no next line.
This solution, however, requires that the user has to learn the programming language used in the dot-file, and has to read lots of documentation to find out which configurations can be made. This task may be difficult and tedious, and for that reason many users often choose to use the default configuration of the program.
If you take a look at some dot-files, you may find that most of the configurations can be described by the following items:
When you start TDG, you will be offered a list of standard configurations, where you may pick one to start out with. This may be convenient, if you do not have a dot-file for the given program, or if you would like to try a new configuration. If on the other hand, you already have a dot-file, which you would like to put the finishing touches to, you may read this file into TDG. Note, however, that it is not all modules, which have the capability to read the dot-file (the fvwm2, rtin and elm modules have, the other modules do not, since it would be to complicated to create such a parser.)
When you have selected a start-up configuration, the menu-window will be displayed (see figure 1). In this window, you can travel through the configuration pages, just like a directory structure. If you select a page, a new window will be displayed, with the configuration for this page (see figure 2). This window will be reused for all the configuration pages, ie. only one configuration page is visible at a time, so you do not have to destroy the window yourself.
In region 3, information is shown on what will be generated. You have three possibilities:
When you have done all the configurations, you have to tell TDG which file you wish to generate. This is done from the Options menu (Setup->Options). And now it's time to create the actual dot-file, which is done by selecting Generate in the File menu.
Once you have generated the dot-file, you may find that you would like some of the configuration to be different. You could now go to the configuration page in question, change your configuration, and then generate once again. If, however, you are testing several different options for a single configuration (ie. several items from a pull-down menu) you may find it cumbersome to generate the whole module over and over again. In this situation, you may chose Regenerate this page in the File menu. Note, however, that if some part of the configurations on the page effects other pages, these will not be generated, so in these situation you have to generate the whole module.
To see how to use the generated dot-file, please go to the Help menu, and select the How to use the output item.
This ExtEntry has three visible tuples, though only two of them contain values (you can see, that the third one is grayed out). To add a new tuple to the ExtEntry, you have to press the button in the lower right corner, just below the scroll bar. If the ExtEntry contains more tuples than can be shown in it, you may scroll to the other tuples with the scroll bar.
If you press the left mouse button on one of the scissors, a menu with four elements will be displayed. These elements are used to cut, copy and paste tuples within the ExtEntry.
If the tuples get very large, only one of them may be shown on the screen at a time. An example of that is seen in figure 4.
When the tuples contain many widgets, scrolling the ExtEntry becomes slow. In these cases, the ExtEntry may have a quick index. In figure 4, you can see the quick index at the top of the ExtEntry (it's the button labeled Idx.) When this quick index is invoked, a pull-down menu is display with the values of the element associated with the quick index. This makes it much easier to scroll the ExtEntries.
In TDG, a special widget has been created called a FillOut, which does configurations like the above. In Figure 5, you can see a FillOut widget from the Bash module. At the top of the widget there is an entry, where you can type ordinary text. Below it, the tokens are placed. If you select one of the tokens, it is inserted in the entry at the point of the cursor. Some of the tokens may even have some additional configurations. Eg. the token Current working directory has two possible options: Full directory, and only the last part. When tokens with additional configurations are selected, a window will be displayed, where these configurations can be done. If you wish to change such a configuration, press the left mouse button on the token in the entry.
The widgets will appear as a button within TDG, and when the button is pressed a new window will be displayed, where the actual configuration is done.
Next time you enter TDG, your saved file will be one of the the files you will be offered as a start-up configuration.
One important point you have to note is that this save file is an internal dump of the state of TDG. This means that this file dependson the version of TDG and the module. This means that if you wish to send a given configuration to another person, this format is not appropriate. A version independent format exists, which is called the export format. To create such a file, you have to select Export instead of Save in the File menu.
Sometimes you may wish to restore the configuration on a single page, to its value as it was before you started playing around with it, or you may wish to merge another person's configuration with your own. This is done by selecting Reload in the File menu. To tell TDG that you only want to reload some of the pages, you have to select the Detail button in the load window. This will bring up a window, where you can select which configuration pages, you wish to reload. Here you can also tell it how you want the pages to be reloaded. You have two possibilities:
It's always a good idea to have a bookmark on this page, as work is currently in progress on new modules.