tkgoodstuff Preferences Manager

# Configuring TkGoodStuff with the Preferences Manager

The preferences manager lets you view and set all preferences and configuration parameters for tkgoodstuff. You enter it from the tkgoodstuff menu (which, by default, is available by clicking on the clock and also within a menu on the Menu client button).

In addition to selecting and arranging the elements of your panels, you can adjust fonts, colors, icons, "tiled" backgounds, the default screen-edge or orientation, and a zillion other things, including the setup for each client (e.g., the Menu client's menu, the Biff client's mailboxes, etc.).

Changes do not take effect until they are saved and tkgoodstuff is restarted. All configuration information is saved to the configuration file (by default, ".tkgrc" in the user's home directory---which you can edit by hand if things go so wrong that the preferences manager won't work).

## Setting Preferences

It should be fairly obvious how to set various preferences: you find them through the notebook pages and menus in the preference manager and set them, e.g., by clicking on an indicator or by entering text.

You might want to set a preference based on an environment variable. You can do this by using "$env" as follows. To set a certain preference to a value based on the user's home directory, you can enter this:

    $env(HOME)/whatever

## Including and Configuring a Client

To include a client (for example, Clock), you enter the preferences manager and use mouse button 3 at the desired point in the configuration (which is presented as a hierarchical list) to choose "Insert", at which point you enter the name of the client.

You configure a client in the preferences manager (double click on its entry in the configuration).

## Adding a Button

You can easily add a button to display an icon and/or a bit of text, which runs a command when pressed. You need to decide:

- If you want an icon on your button, then the icon filename. The file can contain an image of any of several formats (see Icons for more).
- If you want a bit of text on the button (either under the icon or by itself), then the text string (a "\n" in the string makes a line break for multi-line text). E.g., "Telnet to/nwork".
- The (unix) command to run. E.g.:

     xdir "xless /var/adm/syslog"
     rxvt -T Syslog -sl 400 -e {"tail -400 -f /var/adm/syslog"}
     rxvt -T Syslog -sl 400 -e \"tail -400 -f /var/adm/syslog\"

(The last two are equivalent.)

You add the button in the Prefernces manager by choosing "Insert" with mouse button 3 at the desired place in your configuration, and entering the desired information. Double-click on the Button's entry in the configuration to configure it.

Notes:

- The expression "@selection@" in a unix or tcl command will be replaced by the current X selection.
- By default, a unix command button stays down and inoperative after you press it until the launched unix command terminates. This is so you can see that you're already running that command. You can configure the button to pop back up after launching the command, ready to launch the command again.
- When you press an already-depressed unix command button, if you are running tkgoodstuff as an fvwm module, by default you move to the next window that is named by the name of the unix command of the button. But you can configure the button to look for an alternative window name (for instance, the program tkman names its window "TkMan", netscape "Netscape" and so on).

## PanelButtons

A PanelButton is like a standard tkgoodstuff button, except that what it does is to produce an additional tkgoodstuff panel adjacent to the panel containing the PanelButton (this allows you to group a of buttons together and have them appear when you press a single button in your main panel). To add such a button use the "Insert" mouse-3 menu item, and double-click to configure.

See below on how to create Panels.

## PutPanel

Instead of having a Panel produced by a PanelButton, you might want an additional Panel to be placed on the screen at startup. To do this, (as always) use the "Insert" mouse-3 menu item, and double-click to configure.

See below for how to create Panels.

## Adding a Label Box

To add a box containing a bit of text (which differs from a button in look, in color, and in that it doesn't run any command), use the good old "Insert" trick.

## Swallowing an Application

If you want to include a utility that tkgoodstuff doesn't provide, you can incorporate it in your tkgoodstuff panel as a "Swallow" item. Use the preferences manager to do this.

WARNING: this can be tricky. Some hints:

- Before starting, be sure you know the windowname of the window that you want to swallow. By default we look for the name of the application, but many applications produce windows with different names. If you don't specify the correct name, tkgoodstuff will wait forever for the window to show up.
- It sometimes helps to specify in the application command line a geometry for the application that is larger than the window you want to produce.
- If the application has a set size, you can find out what it is with fvwm's Identify module (if you use fvwm).
- In your application command line, you can specify the tkg background color (for your application to use) as \$background (same for foreground and some other resources). Also, use \$width to specify the Swallow window width (same for height).
- If you are running tkgoodstuff as an fvwm module, you can swallow other fvwm modules (like FvwmPager) simply by using the module name in place of a unix command.

## Filling Space

If you are using screen-edge mode (for a bar covering one edge of the screen), then by default all the buttons, clients, etc., are stacked together in the middle of the bar. But you can indicate where the buttons, clients, etc., are to be broken apart by the item "Fill" (which you insert into your configuration like anything else). For example, suppose you have screen-edge mode set to "bottom", you have four buttons in your bar, and you include "Fill" items between the first and second, and between the third and fourth Button items. Then, your bar will contain the first button at the far left, the second and third buttons together in the middle, and the fourth button at the far right. (The WindowList client behaves like a "Fill" region; in particular, in the absence of Fill commands, it uses all available space.)

## Stacks

The Screen Geometry screen-edge and orientaton preferences govern the main orientation of your panel; it may be either horizontal or vertical. If you simply add elements (Clients, Buttons, etc.), these elements will be stacked all in a row left-to-right (if horizontal) or top-to-bottom (if vertical). This probably is what you want in an always-on-top desktop button bar. However you may want to stack two or three small buttons together, or to generate a fancier panel, with several rows or with several bundles of related buttons and label-boxes of different sizes, as in this screenshot (available only on the tkgoodstuff web page; to see it otherwise, just run "tkgoodstuff -f stacks" in the sample-rc directory).

A Stack is itself an item, which is placed in your panel just like a Button. The difference is that a Stack can have items placed within it. These items are stacked together in the orientation you choose (you can also configure other features of a Stack). To explain the stacking commands it is easiest just to explain how the fancy example was created. We start horizontally (the Orientation preference is set to horizontal). We will put together two things horizontally, both of them vertical Stacks. These are the only items that are in the main stack itself. The first vertical Stack starts with the Clock client and a labelbox ("Utilities"). Then we want three buttons side-by-side, so we start a new horizontal Stack. In this Stack we insert three Buttons. This puts us back in the construction of our first (vertical) Stack, which so far contains the Clock, the "Utilities" label, and the Stack we have just finished. The last thing in this vertical Stack will be another horizontal Stack, this one with a colored border four pixels wide. Two Buttons are inserted in this bordered Stack. Now we're done with the first main vertical Stack.

This puts us back in the orignal (horizontal) orientation, outside of all Stacks. So the next item we define will go to the right of the big vertical Stack we have just defined. This item will be an even bigger vertical Stack, which contains a label box, a horizontal Stack (which contains the Net Client, the Load Client, and a vertical Stack of three Buttons) and a (gold-bordered) vertical Stack, which contains a label box and a horizontal Stack (which contains three Buttons and a vertical Stack containing three Buttons).

I hope that makes the working of the stacking apparatus clear. If not, play around with it and you will figure it out.

## Panels

You create a Panel by "Inserting" it anywhere in your configuration. It doesn't matter where you insert it, since it is not an item that is placed inside the main panel, but rather is placed by a PutPanel item or a PanelButton. Various features of the Panel can be configured.