TkGoodStuff Fvwm Client

# TkGoodStuff Fvwm2 Interface

## Description

Tkgoodstuff can interact with the fvwm2 window manager (or the fvwm95 window manager; but see below).

The main reason for the Fvwm2 interface is to enable some of tkgoodstuff's cool clients: WindowList and Pager. The Fvwm2 interface also makes the default behavior of a depressed unix command button to move to and raise the (next) window in which the command is running. Also, for each button you can choose "fvwm button behavior", which means that the button's relief will depend on whether there is any open window whose name matches a specified pattern (whether you started the app with the tkgoodstuff button or not).

It also allows you to:

- Use the tcl commands of the tkfvwm extension in your buttons and clients. To give a hint of the sort of thing you can do by sending commands to fvwm, here is a Tcl command (contributed by Eric Kahler), that tells fvwm to post its "Utilities" menu (you can make a button run this command):

    fvwm send 0 {Menu Utilities Nop ""}

- Use the tcl command "FvwmNextOrExec" (say, with a button), which raises the (next) window of the application you specify if it's already running, or starts the application if not.
- Use the tcl command "FvwmNext", which moves to and raises the next instance of the application you specify.

## Invocation and Use

You do not do anything in your tkgoodstuff preferences to use the fvwm2 interface. It loads automatically if tkgoodstuff is started as an fvwm module.

The fvwm2 interface REQUIRES that you run fvwm2. It has usually worked with fvwm95 just fine; however, I don't keep up with fvwm95, so there's no guarantee that it will work with the latest version. Note that fvwm2 allows "mini-icons" in the title bar, and otherwise lets you set the appearance of windows to look much like fvwm95. Fvwm2 is also very well supported. I recommend it highly.

You must start tkgoodstuff as an fvwm2 module. To do this, in your .fvwm2rc set ModulePath to a directory path which includes your tkgoodstuff library directory. For example:

    ModulePath /usr/lib/X11/fvwm2:/usr/local/lib/tkgoodstuff

You now have an fvwm2 module called "tkgoodstuff", which you invoke like any other fvwm2 module, e.g., in fvwm2's InitFunction. Here's how:

    AddToFunc InitFunction "I" Module tkgoodstuff

You also can make "Module tkgoodstuff" an item on your fvwm menus. To specify a configuration file, use "Module tkgoodstuff -f filename".

Also, if you use tkgoodstuff as a module, the fvwm2 window style pararmeters for the tkgoodstuff panel will be set automatically (though you can defeat this in the preferences manager).

### FvvwmNextOrExec

You can use FvwmNextOrExec wherever a tcl command is called for---e.g., in a Button or Menu item, as follows:

    FvwmNextOrExec emacs

This will zap you to a running emacs window, or start emacs if there is no such window. (What it actually does it to tell fvwm to move to and raise the next window called "emacs" (either its window name or its resource class) in tkgoodstuff's list of windows if there is one, and to run the unix command "emacs" otherwise. An optional second argument is for a different window name to look for (in case the window is not called by the program name. This example, however, is probably not something you would need to do, because a Button with the unix command "emacs" (when tkgoodstuff is a module) does better automatically: it makes the raised button run emacs and stay down until the emacs session is over, AND clicking on the sunken button now focuses on an emacs window (if there are several, we cycle through them). But FvwmNextOrExec might be useful, for instance, if you prefer not to have a sunken button.

Also, there is a button option 'Fvwm button behavior', available in the preferences manager, that makes the button's relief depend on whether there are any windows of a given name (thus the button will be sunken even if you started emacs before starting tkgoodstuff).

### FvwmNext and FvwmPrev

    FvwmNext cmd ?name?

(Primarily for "advanced" users and client writers.) These commands enable you to go to the next (or previous) window with a given name. Repeated calls will cycle through all windows with the given name.