[ home | FAQ | download | troubleshooting | manual | cvs | mailing lists ]

# T.F.M. for Users

## caveat user

MGM is targetted at the power user that despises safety-interlocks. Out of the box, it Just Works. If you want to fiddle around with things (and I know you want to fiddle around with things), MGM is designed to let you try pretty much anything you want to with the X resources. It gives you all the rope you need to shoot yourself in the foot in any number of creative ways. It's fairly easy to make the code fall over by doing overly silly things, so be warned; MGM is generally not going to say 'no'.

Thus, I don't want to hear any complaints about setting a negative window area and the darned thing trying to do it. Bugs are a different matter, of course. If you find a genuine case of "this should work, but it doesn't", fix it and submit a patch (or at least write mgm@xiph.org about it). This documentation is also under source control. Don't forget to patch bugs in the documentation.

## beginning

MGM is configured via X resources, like procmeter used to be. As an example, my .Xresources entries for MGM look like this:

    mgm*background:		#222222
    mgm*textpad:		0
    mgm.Forks.active:	false
    mgm.Swapstat.active:	false
    mgm.Pagestat.active:	false
    mgm.Context.active:	false
    mgm.Phoon*background:	black
    mgm.Phoon*foreground:	white
    mgm.Clock*background:	black
    mgm.Clock*foreground:	white
    mgm.geometry:		450x62+1+1

Resources can be set on the command line; for example, if given the following:

    mgm -background DimGray

MGM parses the command line equivalent to `mgm*background: DimGray`. Tk allows resource priority levels (a useful feature on which MGM relies). Higher priorities take precedence over lower priorities (for details, see 'perldoc Tk::option'). Resources on the command line are given a resource priority of 80 (and thus generally take precedence over entries in .Xresources, which take precedence over built-in settings).

## resource naming

The MGM main window has a name of 'mgm' and a class of 'Mgm'. In the below examples, I use the window name to set resources. (Note that due to a Tk feature, specifically message passing between applications, all Tk MainWindows have a different name. Thus, the first MGM started should be named 'mgm', the second 'mgm #2' and so on. However, Tk seems to have difficulty on some boxes and all but the first MGM end up being '#3'.)

A number of resources are global to all of MGM. Most resources, however, are set by module. Module resources may be set for all modules of a given type (the module class is the same as the module name capitalized. Most of the entries in my .Xresources file above are by-Class entries). Modules may also be configured by instance; modules are numbered from 0 to n-1 (left-to-right or top-to-bottom). For example, to set a blue background for module number three, one should use:

    mgm.3*background:   blue

Most modules use bargraphs; individual bars are also addressable as:

    mgm*Class.bar.number

or

    mgm.number.bar.number

## resource lists

### Global resources

The following resources are set once for the MGM main window and affect all of MGM. They should be set as "`mgm.resource`".

- bars
- geometry
- lendemand
- stack
- widdemand

### Instance resources

The following resources are common to all modules and may be set at the main window for all modules by using "`mgm*resource`". They may also be set for individual module classes or module instance. A number of modules use Xresources beyond the list below; these resources are discussed in the documentation for the relevant module.

- active
- background
- borderwidth
- dimbackground
- dimforeground
- dimrelief
- font
- foreground
- label
- labelsize
- litbackground
- litforeground
- litrelief
- minx
- miny
- order
- ratio
- reconfig
- relief
- scale
- scalecolor
- scalejustify
- scalelenadj
- scalerefresh
- scalereturn
- scalescroll
- scalethresh
- scalewidadj
- textpad
- widgetpad

### Module documentation

A number of modules implement extra features or resources. Documentation for each module currently distributed with MGM appears below.

- battery
- biff
- clock
- context
- cpustat
- diskstat
- diskuse
- forks
- hostlogo
- loadav
- memuse
- netstat
- pagestat
- phoon
- spacer
- swapstat

## A very few examples

### Vertical mode

command line:
`mgm -bars horizontal -stack vertical`

Xresources:

    mgm.bars:       horizontal
    mgm.stack:      vertical

### Single battery graph with a picture

Xresources:

    mgm*active:                false
    mgm*Battery.active:        true
    mgm*Hostlogo.active:       true
    mgm*Hostlogo.label:
    mgm*Hostlogo.logopixmap:   ~/battery.xpm
    mgm.bars:                  horizontal

(of course, the picture actually has to exist)

## Todo

### More modules

Other platforms still need the basic modules. All platforms need more modules in general.

### Module subclassing

Most modules use the same hooks; they should be subclassed from a general graphing module supertype.

### Resources

Quite a few settings remain hardwired for no terribly good reason (eg, scale labels, fixed/autoranging graphs, etc). They should be generalized to resource settings.

### Time graphs

Right now, MGM only does instantaneous graphing with bargraphs (what I happen to like). It should have time graphing ala procmeter and xload as well (note that there's some trickiness here).

MGM will not get your whites whiter or your colors brighter. It will, however, sit there and look spiffy while sucking down a major honking wad of RAM.

MGM, Xiphophorus and their logos are trademarks (tm) of Xiphophorus. These pages are copyright (C) 1994-1999 Xiphophorus. All rights reserved.