NAME

FvwmEvent - the fvwm event module

SYNOPSIS

FvwmEvent is a more versatile replacement for FvwmAudio. It can in general be used to hook any fvwm function or program to any window manager event. E.g: Delete unwanted Netscape Pop ups or application error pop ups as they appear, play sounds, log events to a file and the like. Be creative, you’ll find a use for it.
 
FvwmEvent is spawned by fvwm, so no command line invocation will work. From within the .fvwm2rc file, FvwmEvent is spawned as follows:
 
Module FvwmEvent
 
or from within an fvwm pop-up menu:
 
DestroyMenu Module-Popup
AddToMenu Module-Popup "Modules" Title
+ "Event"        Module FvwmEvent
+ "Auto"         Module FvwmAuto 200
+ "Buttons"      Module FvwmButtons
+ "Console"      Module FvwmConsole
+ "Ident"        Module FvwmIdent
+ "Banner"       Module FvwmBanner
+ "Pager"        Module FvwmPager 0 3

DESCRIPTION

The FvwmEvent module communicates with the fvwm window manager to bind actions to window manager events. Different actions may be assigned to distinct window manager events.
 
FvwmEvent can be used to bind sound files to events like FvwmAudio (RiP) did. It can be used for logging event traces to a log file, while debugging fvwm.

INVOCATION

The invocation method was shown in the synopsis section. No command line invocation is possible. FvwmEvent must be invoked by the fvwm window manager.

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, new_desk will have the new desk number. The windowID is a hexadecimal string preceded by 0x, desk numbers are decimal.
 
*FvwmEvent: window-manager-event action-or-filename
Binds particular actions to window manager events.
 
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, or builtin-rplay. If fvwm's Exec function is used, any external program can be called with any parameter.

AUTHORS

1994  FvwmSound  Mark Boyns       ([email protected])
1994  FvwmAudio  Mark Scott       ([email protected])
1996  FvwmAudio  Albrecht Kadlec
1998  FvwmEvent  Albrecht Kadlec  ([email protected])

Recommended readings

Pages related to Fvwm3Event you should read also: