The first thing to setup is the global settings, such as environment variables, and the basic set up of the desktop. An environment variable is like one used in a shell, you can store values in it that you can then use them in various places though out your fvwm2rc file, and then if you preferences change its not that hard to change the variable (instead of each instance in the file). I use environment variables mainly to tell fvwm where to look for various items used in the config.

Note though that over-using environment variables leads to a lot of "pollution" within FVWM's evironment space, especially if they're only being used to hold settings which might only ever change once a year. You can see this thread on the fvwm forums for more detailed information.

For example you could set up some environment variables as follows:

#####
# Set Environment variables
###########
SetEnv fvwm_img $[FVWM_USERDIR]/images
SetEnv fvwm_icon $[FVWM_USERDIR]/icons
SetEnv fvwm_scrpt $./scripts
SetEnv fvwm_wallpapers $[FVWM_USERDIR]/wallpaper

You can also use environment variables to set up default programs that you prefer to use, for example;

SetEnv fvwm_webbrowser /usr/bin/firefox
SetEnv fvwm_term /usr/bin/aterm
SetEnv fvwm_mail /usr/bin/mutt
SetEnv fvwm_media_player /usr/bin/xmms
SetEnv fvwm_video_player /usr/bin/mplayer

Next set up the ImagePath. This is similar to the shell environment variable $PATH, which sets up where FVWM will look for images (icons) you ask it to display (for example as quick launch buttons or menu icons). A typical image path would look something like this.

#####
# Set the image path
###########
ImagePath $[fvwm_icon]:$[fvwm_icon];.png:$[fvwm_wallpapers]:+

I put all my icons I use in my $[fvwm_icon] directory. The reason I write it down twice is the second time when I follow it with the ';.png' says that it will be able to use either .xpm files (the default) or .png files for the icons interchangeably. One could easily add more directories to the ImagePath if there were for instance some global images for all users at '/usr/local/share/images' and then personal images locate in $HOME/images that would be used in fvwm.

Next lets set up the Virtual Desktops. FVWM allows you to have as many Virtual Desktops as you would want to set up, and also allows each Virtual Desktop to have multiple Pages. For instance lets assume that you would want to have 3 Virtual Desktops each with 9 pages in a 3x3 grid, you could set it up as follows.

#####
# Virtual Desktops
###########
DesktopSize 3x3
DesktopName 0 Main
DesktopName 1 Work
DesktopName 2 Games
EdgeScroll 100 100
EdgeResistance 150  150
EdgeThickness 1

The DesktopSize sets up the number of pages on each Virtual Desktop, for example 3x3 sets up a 3x3 grid that make each desktop have a set of Pages that look like










I then set up 3 Virtual Desktops, namely Main, Work and Games (numbered 0, 1, 2). The EdgeScroll parameter sets up what percentage of the screen scrolls when you move your mouse to the edge of the screen. 'EdgeScroll 100 100' says if I move my mouse to the edge of the screen that 100% (or the whole) page will scroll over to the next one. EdgeResistance sets up how much 'resistance' or time is needed before the scroll happens. And EdgeThickness sets up how many pixels thick the border around the 'root' window where the the EdgeScroll effect will take place is. If you don't like this behavior, you can either set 'EdgeThickness 0' or 'EdgeScroll 0 0'.

Next lets set up the default Mouse and Focus behavior. An example of this is

#####
# Mouse and Focus Behavior
###########
ClickTime 350
MoveThreshold 3
Style * SloppyFocus, MouseFocusClickRaises

ClickTime is the time in milliseconds between pushing the mouse button and releasing it that FVWM will consider that a 'click'. If that time is exceeded FVWM will consider that a 'hold'. MoveThreshold is the number of pixels the mouse must move before FVWM will consider that action a 'move'. Note, all this stuff will set up the feel of your window manager and is important when making functions.

Styles are used throughout FVWM to set up various Styles of how you want things to act, look, behave, etc. Styles will be used a lot, but for start, lets just look at this style line. In Style statements, *'s are wild cards, so 'Style *' says apply this style to every window. This is followed by a list of styles separated by commas that you wish to use, for example the first Style I have used is SloppyFocus which means that the window in focus is the one with the mouse over it (excluding special windows like the root window). The second Style in that line is MouseFocusClickRaises which says that if I click on a focused window it will raise to the top. Other styles could be 'ClickToFocus', 'ClickToFocusPassesClick', 'ClickToFocusPassesClickOff', 'ClickToFocusRaises' and 'ClickToFocusRaisesOff'. All of which are explained in more detail in the man page.

Besides Styles there are some special key words to set up how the default desktop environment behaves. An example of a few of these are;

EwmhBaseStruts 62 162 0 48
IgnoreModifiers L25

This first line EwmhBaseStruts sets up the 'usable' screen area. How this works is by stating 'EwmhBaseStructs left right top bottom'. The numbers are how many pixels bordering each edge of the screen are used as a padding for maximizing windows and window placement. This setup leaves a bit of space along the right, left and bottom of the screen for the FvwmTaskBar, FvwmPager and FvwmButtons. If you would like the window to ignore this setting you can use the EWMHMaximizeIgoreWorkingArea Style option. The next line tells FVWM to ignore certain modifiers, in this case it ignores the 'Num Lock' modifier and helps in lots of situations.

Some other styles I use in my fvwm2rc file are as follows, I'm not gonna explain them here, but just let you see that there are various other options you can add to your config to further control how the the FVWM Desktop functions.

#####
# Global Styles and options
###########
Style * TileCascadePlacement, GrabFocusOff
Style * NoPPosition, ResizeOpaque
OpaqueMoveSize -1
Emulate MWM
HideGeometryWindow Never
SnapAttraction 5 SameType Screen
SnapGrid 3 3
XorValue 55555
Style * DecorateTransient, DontRaiseTransient
Style * DontLowerTransient, StackTransientParent
Style * GrabFocusTransientOff
Style * WindowShadeSteps 20, WindowShadeScrolls
SetAnimation  10  -.01 0 .01 .03 .08 .18 .3 .45 .6 .75 .85 .90 .94 .97 .99 1.0
Style * MwmDecor, SlipperyIcon
Style * IconBox screen w 15 15 -165 -15, IconGrid 3 3, IconFill right top

Next I setup various program specific Styles. How the Style command works is 'Style [string] [styles]'. FVWM then compares [string] (including wild cards '*') to the Name, Class and/or Resource of a window. To figure out what the Name, Class and Resource of an application is you could use the FvwmIdent Module. This example sets up program specific styles. I mainly set up the MiniIcon and Icon that is associated with the program, though any Style option can be applied to the program.

#####
# Program Styles
###########
Style "*" Icon 48x48/unknown.xpm
Style "XTerm" Icon 48x48/xterm.png, NoActiveIconOverride, MiniIcon mini/xterm.png
Style "gvim" Icon 48x48/gvim.png, IconOverride, MiniIcon mini/gvim.png, EWMHMiniIconOverride
Style "Firefox-bin" Icon 48x48/firefox.png, MiniIcon mini/firefox.png, EWMHMiniIconOverride
Style "irssi" Icon 48x48/gaim.png, MiniIcon mini/irc.png
Style "xmms" WindowListSkip, CirculateSkip
Style "MPlayer" Icon 48x48/mplayer.png

Intro index Functions