FvwmStorage

 

FvwmStorage

NAME

FvwmStorage - Create, save and load variables and execute commands using them

SYNOPSIS

FvwmStorage should be spawned by fvwm(1) for normal functionality.

Run this module from your StartFunction:

AddToFunc StartFunction
+ I Module FvwmStorage

Then you can send commands to FvwmStorage, e.g.:

AddToFunc StartFunction
+ I SendToModule FvwmStorage set@bg: cmd=Exec exec display \
    -window root %(file)
+ I SendToModule FvwmStorage trigger@bg: file=SendToModule \
    FvwmStorage exec@bg: %(cmd)

AddToFunc setbackground
+ I SendToModule FvwmStorage set@bg: file=$0

DESCRIPTION

FvwmStorage is a fvwm module written in Perl. It lets you define variables, load and store then from/to files and execute any fvwm command using this variables. It is especialy useful to interactively change the fvwm configuration.

FvwmStorage is organized in different “boxes” each of which defines its own name space for variables and triggers and is saved to its own file.

For every variable you can define a trigger which is executed every time this variable is changed.

Every variable can have a default which is used if this variable is not defined. Changing a default does never execute a trigger, even if the corresponding variable is not set.

INSTALLATION

Copy FvwmStorage into your fvwm module directory, e.g.:

sudo cp FvwmStorage $(fvwm-config -m)/

USAGE

Run the module, supposedly from StartFunction in .fvwm2rc:

Module FvwmStorage

Then send commands to it:

SendToModule FvwmStorage command

Valid commands are:

set

set@box: variable=value

Set variable variable of box box to value.

See dumpv for how to print all defined variables.

del

del@box: variable

Delete variable variable of box box

trigger

trigger@box: variable=command

Define trigger trigger for variable variable of box box Every time variable is changed trigger will be send to Fvwm.

See dumpt for how to print all defined triggers.

See deltrigger for how to delete a trigger.

See exec for how command should look like.

deltrigger

deltrigger@box: variable

Delete trigger for variable variable of box box

See trigger for how to define a trigger.

See dumpt for how to print all defined triggers.

default

default@box: variable=value

Set default for variable variable of box box to value. A default is used if the corresponding variable is not defined. Changing a default never executes a trigger even if the corresponding variable is not defined.

See dumpd for how to print all defined defaults.

See deldefault for how to delete a default.

deldefault

deldefault@box: variable

Delete default for variable variable of box box

See default for how to define a default.

See dumpd for how to print all defined defaults.

dumpv

dumpv@box:

Prints all variables of box box.

See set for how to define variables.

dumpt

dumpt@box:

Prints all triggers of box box.

See trigger for how to define triggers.

dumpd

dumpd@box:

Prints all defaults of box box.

See default for how to define triggers.

exec

exec@box: command

Send command to Fvwm. command can be any string fvwm understands. Substrings matching %(variable) will be replace by the variable variable of box box. If variable is not defined it will be replaced by an empty string.

execif

execif@box: variable? command

Send command to Fvwm if variable is defined and has not a value of 0

See exec for how command should look

See set for how to define variables

load

load@box: file

Load box box from file file. If no file is given box is used as file name.

See save for how to save a box.

loadorexec

loadorexec@box: command

Tries to load box box from its default file. If this file doesn’t exist command is executed.

This is especially useful if you want to initialize a box with some values if it does not exist, but don’t want to override its values if it exists already.

See load for more information about loading.

See exec for how command should look.

See save for how to save a box.

save

save@box: file

Save box box to file file. If no file is given box is used as file name

See load for how to load a file.

autosave

autosave@box:

Activates autosave mode for box box. The box is saved every time something in this box is changed.

See noautosave for how to deactivate autosave mode.

noautosave

noautosave@box:

Deactivates autosave mode for box box.

See autosave for how to activate autosave mode.

debug

debug@box:

Activates debug mode for box box.

See nodebug for how to deactivate debug mode.

nodebug

nodebug@box:

Deactivates debug mode for box box.

See debug for how to activate debug mode.

SPECIAL VARIABLES

Every box has a variable self which contains the name of the box. You can’t modify this variable.

STARTUP

At startup first module options are read. The syntax is:

*FvwmStorage: command

Where command is any valid FvwmStorage command as described above.

Then the box .startup is loaded if it exists. Using triggers you can use this to load other boxes, e.g.:

SendToModule FvwmStorage trigger@.startup: bg=SendToModule \
             FvwmStorage load@bg:
SendToModule FvwmStorage set@.startup: bg=1