with zero or a positive integer). For example "$[fg.cs3]" is
expanded to the name of the foreground color of colorset 3 (in
rgb:rrrr/gggg/bbbb form).
If .lighten or .darken
is appended to the parameters, they
are instead replaced with a color that is lighter or darker than
the one defined in colorset by a percentage value (between
0 and 100). For example "$[bg.cs3.lighten15]" is expanded to the
background color of colorset 3 and then lightened 15% (in
rgb:rrrr/gggg/bbbb form).
If .hash is appened to the end the color output will use #rrggbb
form (instead of rgb:rrrr/gggg/bbbb). For example, $[bg.cs3.hash]
or $[bg.cs3.lighten15.hash].
Please refer to the Colorsets section for details about colorsets.
$[math.+.,] $[math.-.,] $[math.*.,] $[math./.,]
$[math.%.,] $[math.^.,] $[math.<.,] $[math.>.,]
The math expansion variables can be used to do some basic
arithmetic on the integers and . These expressions can be
used to add (+), subtract (-), multiply (*), divide (/), modulus
(%), and exponentiation (^). Maximum (>) returns the greater of two
values, and minimum (<) the lesser. This can be useful when
computing the size of panels or locations of windows relative to a
monitor, for example
$[math.-.$[monitor.$[monitor.primary].height],200] will subtract
200 pixels from the height of the primary monitor. These can also
be nested for more complex operations,
$[math.+.$[math.*.3,5],$[math.-.4,-2]] is replaced with 21.
The comma in "," is to allow for a future possibility of
using floats. All operations use C integer mathematics. The result
of integer division is the quotient. The modulus can be used to get
the remainder of the integer division. Note that the C modulus
returns negative remainders for negative values. Finally the
exponentiation operation returns 1 if is negative.
$[schedule.last]
This is replaced by the id of the last command that was scheduled
with the Schedule command, even if this command was already
executed.
$[schedule.next]
This is replaced by the id the next command used with Schedule will
get (unless a different id is specified explicitly).
$[cond.rc]
The return code of the last conditional command. This variable is
only valid inside a function and can not be used in a conditional
command. Please refer to the section Conditional Commands in the
command list.
$[func.context]
The context character of the running command as used in the Mouse,
Key or PointerKey command. This is useful for example with:
Mouse 3 FS N WindowShade $$[func.context]
$[debuglog.state]
Either 0 (debug log closed) or 1. Indicates the current state of
debugging and logging facility.
$[gt.str]
return the translation of str by looking in the current locale
catalogs. If no translation is found str is returned as is. See the
LocalePath command.
$[infostore.key]
Return the value of the item stored in the InfoStore at the given
key. If no key is present, the unexpanded string is returned.
$[...]
If the string within the braces is neither of the above, fvwm tries
to find an environment variable with this name and replaces its
value if one is found (e.g. "$[PAGER]" could be replaced by
"more"). Otherwise the string is left as is.
Some examples can be found in the description of the AddToFunc
command.
SCRIPTING AND COMPLEX FUNCTIONS
To achieve the more complex effects, fvwm has a number of commands that
improve its scripting abilities. Scripts can be read from a file with
Read, from the output of a command with PipeRead or written as a
complex function with the AddToFunc command. For the curious, section 7
of the fvwm FAQ shows some real life applications of scripting. Please
refer to the sections User Functions and Shell Commands and Conditional
Commands for details. A word of warning: during execution of complex
functions, fvwm needs to take all input from the mouse pointer (the
pointer is "grabbed" in the slang of X). No other programs can receive
any input from the pointer while a function is run. This can confuse
some programs. For example, the xwd program refuses to make screen
shots when run from a complex function. To achieve the same
functionality you can use the Read or PipeRead command instead.
MENU CONCEPTS AND COMMANDS
Please refer to the fvwm3menus man page.
LIST OF FVWM COMMANDS
Please refer to the fvwm3commands and fvwm3styles man pages.
ENVIRONMENT
The environment variables that have an effect on how fvwm operates are
the following:
DISPLAY
Fvwm starts on this display unless the -display option is given.
FVWM_USERDIR
Used to determine the user's data directory for reading and writing
files. If this variable is not already set, it is set by fvwm to
$HOME/.fvwm, which is the default user's data directory.
FVWM3_LOGFILE
Used to determine the path and filename to log debug information
from fvwm3. By default debug log is written to
$FVWM_USERDIR/fvwm3-output.log . If an absolute path is specified
(starting with /) then $FVWM_USERDIR is ignored, otherwise the log
is written to $FVWM_USERDIR/$FVWM3_LOGFILE .
FVWM_DATADIR
Set by fvwm to the directory containing fvwm config and module
data.
FVWM_MODULEDIR
Set by fvwm to the directory containing the standard fvwm modules.
SESSION_MANAGER
Fvwm tries to contact this session manager.
SESSION_MANAGER_NAME
This is used mainly to determine xsm running to work around its
bug. If this variable is set to "xsm", DiscardCommand is set as xsm
expects it and not as XSMP requires. If you run fvwm under xsm, you
should set this variable to "xsm", otherwise old state files are
not removed.
SM_SAVE_DIR
If this is set, fvwm saves its session data in this directory.
Otherwise it uses $HOME. Note, the state files are named .fs-??????
and normally are removed automatically when not used anymore.
AUTHORS
Robert Nation with help from many people, based on twm code, which was
written by Tom LaStrange. After Robert Nation came Charles Hines,
followed by Brady Montz. Currently fvwm is developed by a number of
people on the fvwm-workers mailing list.
COPYRIGHT
Fvwm and all the modules, scripts and other files coming with the
distribution are subject to the GNU General Public License (GPL).
Please refer to the COPYING file that came with fvwm for details.
BUGS
Bug reports can be sent to the fvwm-workers mailing list at
The official fvwm homepage is
2026-06-28 FVWM3(1)