-->
Previous Table of Contents Next


Configuring Fonts and Colors

The foremost area you’ll likely customize in the .fvwmrc file is fonts and colors.

Each window manager, including fvwm, allows only one application at a time to get keyboard input. This window, usually called the active window or the keyboard focus window, is usually highlighted by the window manager. In the .fvwmrc file, the HiForeColor sets the text foreground color for the active window’s title. The HiBackColor sets the active titlebar color. The StdForeColor and StdBackColor work similarly for nonactive windows.

We use the following colors (copied from the default .fvwmrc file):


  StdForeColor        Black

  StdBackColor        #60a0c0



  # this is used for the selected window

  HiForeColor         Black

  HiBackColor         #c06077

Window managers usually support two policies for selecting which window is made active: click-to-focus and focus-follows-mouse. Few people agree on which is better (Microsoft has decided click-to-focus is better, though). Choose the mode you want.

If you want focus-follows-mouse, ensure that the following line is commented out:


  #ClickToFocus

If you want click-to-focus, then uncomment (remove the # character) the same line:


  ClickToFocus

For fonts, you can control a number of the fonts used by fvwm:


  Font       -adobe-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*

  #Font      -*-times-medium-i-*-*-*-140-*-*-*-*-*-*

  WindowFont -adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*

  #IconFont  -adobe-helvetica-medium-r-*-*-11-*-*-*-*-*-*-*

  IconFont   fixed

The asterisks (*) in the font names are wildcards. We only specify the minimum amount of data necessary to get Helvetica fonts at 10 and 12 point. A few fonts are commented out. You can uncomment these lines (and comment out the corresponding line) to try these other fonts, or type in your own font names.

By default, fvwm asks you to place each new window that appears on the screen. This can be a real pain, so we usually ask fvwm to place windows for us—you can always move them later—by setting the oddly named RandomPlacement option. Uncomment the following line to get this effect:


  RandomPlacement

You also need to comment out the following line:


  #NoPPosition

By default, fvwm places no border around dialog windows (called transient windows in X terminology). To make fvwm act more like the Motif window manager, uncomment the following line:


  # If you want decorated transient windows,

  # uncomment this:

  # Ensure that a titlebar appears on dialogs.

  DecorateTransients

Testing Your Fvwm Configuration

Now that we’ve made a change to our .fvwmrc file, it’s time to test our new configuration. To do this, you need to restart fvwm. You can either quit X and restart everything or call up Fvwm’s root window menu, where you’ll find a Restart fvwm choice. (It may be on a submenu.) You can access fvwm’s root menu by holding down the left mouse button over the screen background.

Turning off the Virtual Desktop

Both XFree86 and fvwm provide the ability to use virtual screen space, screen space beyond the confines of your monitor’s resolution. XFree86 calls this a virtual screen, and fvwm calls this a virtual desktop.

These two methods tend to conflict, and frankly, we don’t have much use for either kind of virtual screen space, as we don’t run that many X applications at once and we can iconify windows to get them out of the way. Furthermore, it’s easy to accidentally warp to one of fvwm’s virtual desktop spaces, which tends to get annoying.

Because of all this, we turn off fvwm’s virtual desktop in our .fvwmrc file with the following:


     DeskTopSize 1x1

You specify the desktop value in units of the screen size; 1×1 means no virtual desktop.

Placing Icons

Fvwm’s defaults result in bizarrely placed icons, with hidden icons strewn throughout the screen. We want to change this. To do so, use the IconBox command in the .fvwmrc file. We like our icons to go across the top of the screen, but we start from an offset of about 130 pixels to leave room for the round oclock window we place in the upper-left corner of the screen. (See our .xinitrc file, listed earlier.)

The IconBox specifies a rectangular area where you want the icons to appear. Here’s our area:


  IconBox 130 5 600 15

Configuring the Good Stuff

Fvwm also supports something called modules, add-ons that you can configure and run. The most popular add-on is called GoodStuff; it places a window on your screen from which you can launch applications or menus, sort of like a toolbar or the Windows 95 command area at the bottom of the screen.

Then you can turn on GoodStuff by uncommenting the GoodStuff lines in the InitFunction and RestartFunctions sections:


  Function "InitFunction"

  #Module  "I" FvwmBanner

  #Exec    "I" xpmroot /usr/include/X11/pixmaps/fvwm.xpm &

  Module   "I" GoodStuff

  #Module  "I" FvwmPager 0 3

  #Exec    "I" exec xterm -geometry 80x64+0+0 &

  #Wait    "I" xterm

  #Desk    "I" 0 2

  #Exec    "I" exec xmh -font fixed -geometry 507x750+0+0 &

  #Wait    "I" xmh

  #Desk    "I" 0 0

  EndFunction



  Function "RestartFunction"

  #Exec    "I" xsetroot -solid "#266294"

  Module   "I" GoodStuff

  #Module  "I" FvwmPager 0 3

  EndFunction

Either way works. The InitFunction section allows you to specify a set of X applications to launch at fvwm startup. Because this overlaps with the .xinitrc file, we typically skip starting any applications in the InitFunction section.

Toward a Motif-Like Look and Feel

One of fvwm’s claims to fame is that it is a free window manager that looks a lot like the Motif window manager, mwm, used on just about every commercial version of UNIX. Unfortunately, while fvwm looks like Motif, it doesn’t act as much like mwm as you’d expect. The similar look of fvwm can fool you.

Take heart, though, as there are a few things you can do to make fvwm act more like mwm. Take a look at our .fvwmrc file, later, and you’ll see a lot of mwm-like behavior.


Previous Table of Contents Next