FvwmEvent manual page

NAME

FvwmEvent - the fvwm event module

DESCRIPTION

FvwmEvent is a module that triggers actions on fvwm events. It can be used to hook any fvwm function or program to any window manager event. FvwmEvent can trigger actions when windows are added, deleted, iconified, shaded, or when fvwm changes which virtual page or desk is being shown, or when RandR monitors are changed, enabled, disabled, or gain focus. Be creative, you’ll find a use for it.

INVOCATION

FvwmEvent is spawned by fvwm, so no command line invocation will work. FvwmEvent can be spawned from within the config file with or without an Alias as follows:

Module FvwmEvent Alias

You can add this to the StartFunction to ensure FvwmEvent is running and listening for events when fvwm starts. Alternatively you can add this to a menu, key binding, etc. You can kill stop a running instance of FvwmEvent with:

KillModule FvwmEvent Alias

CONFIGURATION OPTIONS

FvwmEvent gets config info from fvwm's module configuration database (see fvwm(1), section MODULE COMMANDS), and looks for certain configuration options:

*FvwmEvent: Cmd command

This determines the fvwm function that is to be called with the event parameters. You might want to do one of the following (details below):

	# execute distinct fvwm functions
	*FvwmEvent: Cmd

	# execute distinct external programs
	*FvwmEvent: Cmd exec

FvwmEvent has support for any other external program. e.g: the rsynth 'say' command:

	*FvwmEvent: Cmd "Exec /rsynth/say"
	*FvwmEvent: destroy_window "window closed"

You can also use fvwm's builtin Echo command as FvwmEvent: Cmd to obtain debug output for fvwm events quietly. I used this setup to debug FvwmAuto:

	*FvwmEvent: Cmd Echo
	*FvwmEvent: focus_change "focus change"
	*FvwmEvent: raise_window "raise window"

You can even call different shell commands for each event just by setting

	*FvwmEvent: Cmd exec
	*FvwmEvent: add_window 'killname "APPL ERROR"'
*FvwmEvent: PassId

Specifies that the event action will have an ID parameter added to the end of the command line. Most events will have the windowID of the window that the event refers to. The new_desk event will have the new desk number. Monitor events will have the RandR monitor name. The windowID is a hexadecimal string preceded by 0x, desk numbers are decimal, and monitor name’s are strings.

*FvwmEvent: window-manager-event action

Binds particular actions to window manager events. The action is appended to the Cmd which is then sent to fvwm for execution.

The following events are valid:

Event

Description

add_window

Occurs when a new window is mapped and visible

config_info

Occurs when a module asks for configuration

configure_window

Occurs when a ConfigureNotify event happens

default_icon

Occurs when a window’s DefaultIcon changes

deiconify

Occurs when a window id deiconified

destroy_window

Occurs when a window is destroyed

dewindowshade

Occurs when a window is unshaded

echo

Occurs when an Echo command is run

end_config_info

Occurs when there’s no more module config to send

end_windowlist

Occurs when the windowlist has finished sending

enter_window

Occurs when a window receives a EnterNotify event

error

DEPRECATED

focus_change

Occurs when a window gains or loses focus

icon_file

DEPRECATED

icon_location

DEPRECATED

icon_name

DEPRECATED

iconify

Occurs when a window is iconified

leave_window

Occurs when a window receives a LeaveNotify event

lower_window

Occurs when a window is lowered

map

Occurs when a window is Mapped

mini_icon

Occurs when a window’s mini icon changes

monitor_changed

Occurs when a monitor’s resolution changes

monitor_disabled

Occurs when a monitor is disabled (via RandR)

monitor_enabled

Occurs when a monitor is enabled (via RandR)

monitor_focus

Occurs when a monitor gains focus

new_desk

Occurs when a new desk is switched to

new_page

Occurs when a new page is switched to

old_add_window

DEPRECATED

old_configure_window

DEPRECATED

property_change

Occurs when a window receives a PropertNotify event

raise_window

Occurs when a window is raised

res_class

Occurs when a window’s Class is set

res_name

Occurs when a window’s Resource is set

restack

Occurs when windows are restacked

sendconfig

Occurs when FvwmEvent asks for its config

shutdown

DEPRECATED

startup

DEPRECATED

string

Occurs when the SendToModule command is used

unknown

DEPRECATED

visible_icon_name

Occurs when a window’s visible icon name changes

visible_name

Occurs when a window’s visible name changes

window_name

Occurs when a window’s name (WM_NAME) is set

windowshade

Occurs when a window is shaded

The window related event handlers are executed within a window context. Previously PassId was used for this purpose, but now using PassId is not needed.

The monitor_* events do not operate in a window context (as there isn’t one), but react to when a monitor is plugged in (enabled), unplugged (disabled), focused (focus) or changed (resized/rotated, etc., which will only be true if the monitor is already active).

The echo event is generated whenever Fvwm receives an Echo command.

Note: The enter_window event is generated when the pointer enters a window. With the -passid option, that window’s id is passed to fvwm. An enter_window event is generated too when the pointer leaves a window and moves into the root window. In this case, the id passed is 0.

Note: When the shutdown event arrives, FvwmEvent may be killed before it can trigger the associated action.

*FvwmEvent: Delay 5

Specifies that an event-action will only be executed if it occurs at least 5 seconds after the previous event. Events that occur during the delay period are ignored. The default delay is 0 which disables the Event.

*FvwmEvent: StartDelay delay

Specifies that an event-action will only be executed if it occurs at least delay seconds after the startup event. Events that occur during the delay period are ignored. This option is useful when fvwm starts and restarts using an audio player. The default delay is 0.

HISTORY

This module has evolved of FvwmAudio, which in term is heavily based on a similar Fvwm module called FvwmSound by Mark Boyns. FvwmAudio simply took Mark’s original program and extended it to make it generic enough to work with any audio player. Due to different requests to do specific things on specific events, FvwmEvent took this one step further and now calls any fvwm function. If fvwm's Exec function is used, any external program can be called with any parameter.

AUTHORS