[Back to Table of Contents] [Using This Help System]

Customization

"The Next Level" provides some easy control for users to customize the general look and feel of their desktop, without complicated FVWM commands. Advanced customizing is another topic.

There are two main files you'll need to look at to select the options you prefer:

.fvwm2rc.defines file

This file specifies numerous options, all in the form of M4 macros. Be careful editing the file, since M4 is very picky about quotations, and uses matching single quotes, and , unlike most other Unix programs.

The .fvwm2rc.defines is thoroughly commented throughout, and you should read those comments carefully as you edit the file.

.Xdefaults-fvwm-defines file

Since X resources control many aspects of the visual appearance of you desktop, you may need to edit this file to create the look and feel you desire. In contrast to .fvwm2rc.defines, this file uses cpp, the C language preprocessor, as the language for its option definitions. This is the default for xrdb. Also note that an exclamation point (!) can be used to initiate a comment in X resource files.

See adding applications for an example of a fairly straightforward customization.


Advanced customization

"The Next Level" is a complex system. Non-trivial customization requires knowledge of many aspects of the Unix and X environments. You should study all files that come with this distribution to see how they all fit together.

There are comments throughout all of the .fvwm2rc.* files which should help explain where various things go. As a simple overview, see the comments at the end of .fvwm2rc.m4. You should also study the numerous macros as they are defined in that file.

To add local applications, you should edit .fvwm2rc.programs. Simple follow the patterns there. Note that if FVWM can't find a program you add to a menu, that menu item won't appear. Ensure your execution path is set properly before FVWM is run by .xsession or .xinitrc.


Fvwm Patch

What It Does

This patch modifies the WindowList command so that if the second argument is negative, only icons are listed in the WindowList. Everything else is as specified in the man page for the WindowList command.

Example

This is in .fvwm2rc.keys:

....
Key Return	A	CS	WindowList 1 -1
....
It makes CS - RETURN give a list of just icons, using their icon names, of programs on any desktop.
....
Key Return      A       CS      WindowList 4 -2
....
Would make CS - RETURN give a list of just icons, using their window names, of only those programs on Desktop 2 (the absolute value of -2).

Applying the patch

Do something like:

tar xzf /a/path/to/fvwm2-XXXX.tgz
cd fvwm2-XXXX
cd fvwm
patch < /the/patch/dir/fvwm-2.0.42-windows.c.patch
cd ..
Patches should succeed completely. Then continue to build fvwm as directed.

Alternatives

If there is a way to do this without patching Fvwm, I'd love to hear about it. This solution may still be the best, since it's a trivial patch, and results in an instantaneous icon menu. The other possibilities all involve executing a module which has much higher overhead.


Zsh Patch

What It Does

This patch adds a new special parameter, called POSTPROMPT, which works like PROMPT, except it is output *after* the current command line gets parsed and added to the history. The patch also adds a new percent-escape sequence to those recognized by PROMPT and POSTPROMPT, "%H", which means the last history line, after parsing. These two features, combined with control characters for setting the title or icon of an xterm/nxterm, give the user the capability to put the currently executing command in the title bar.

Example

The easiest thing to do is just use my ZShell configuration. The pertinent parts are:

setopt INTERACTIVE_COMMENTS
setopt PROMPT_SUBST
PSVAR=" "
PS1='%B%m,%l:%(6c,...%5c,%~)%#%b '
if [ "$TERM" = "xterm" -o "$TERM" = "color_xterm" ]; then
  PS1='%{]0;%m %0v%}'$PS1
  # POSTPROMPT variable requires a patch by 
  POSTPROMPT='%{]0;%H%}'
fi
Where the first character inside %{ is ESC, and the last before %} is Ctrl-G for both PS1 and POSTPROMPT. The strings set the title bar of an xterm. Note that rxvt does not accept xterm control sequences. Since "PROMPT" resets the title bar to the hostname each time a prompt is displayed, you may want to set PSVAR="Whatever" by hand to append a note to the title bar for when it's not executing a command. (Or you may choose to not set the title bar in PS1 [just remove the PS1= inside the if block, above]). Setting INTERACTIVE_COMMENTS allows a more descriptive name to appear in the title bar. eg.
make all #Linux build
Would show the whole command line in the title bar, to make it easier to find that window while the build is going on, while:
PSVAR="Linux Build"
Would keep a "Linux Build" message in the title bar even after the build completed. Setting the option PROMPT_SUBST allows you to embed variables in the PROMPTS which get substituted at print time. eg.
PS1='%B%m,%l:%(6c,...%5c,%~)%#%b %{]0;${USER} on %m %0v%}'
Would make the title bar look something like "gjb on oz", expanding USER to my username.

Applying the patch

tar xzf /a/path/to/zsh-2.5.03.tgz
cd zsh-2.5.03
cd src
patch < /the/patch/dir/zsh-2.5.03.patch
cd ..
Patches should succeed completely. Then continue to build zsh as directed.

Alternatives

If there is a way to do this without this patch, I'd love to hear about it. Also, it'd be great if someone would contribute similar patches for the other shells. ZSh is great, but not everyone uses it.

[Back to Table of Contents] [Using This Help System]


Greg J. Badros / Duke University / gjb@cs.duke.edu