'\" t .\" Title: FvwmEvent .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.26 .\" Date: 2026-01-14 .\" Manual: Fvwm Modules .\" Source: \ \& .\" Language: English .\" .TH "FVWMEVENT" "1" "2026-01-14" "\ \&" "Fvwm Modules" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" FvwmEvent \- the fvwm event module .SH "DESCRIPTION" .sp \fIFvwmEvent\fP is a module that triggers actions on \fIfvwm\fP events. It can be used to hook any \fIfvwm\fP function or program to any window manager event. \fIFvwmEvent\fP can trigger actions when windows are added, deleted, iconified, shaded, or when \fIfvwm\fP changes which virtual page or desk is being shown, or when RandR monitors are changed, enabled, disabled, or gain focus. Be creative, you\(cqll find a use for it. .SH "INVOCATION" .sp \fIFvwmEvent\fP is spawned by \fIfvwm\fP, so no command line invocation will work. \fIFvwmEvent\fP can be spawned from within the \fIconfig\fP file with or without an \fIAlias\fP as follows: .sp .if n .RS 4 .nf .fam C Module FvwmEvent Alias .fam .fi .if n .RE .sp You can add this to the \fIStartFunction\fP to ensure \fIFvwmEvent\fP is running and listening for events when \fIfvwm\fP starts. Alternatively you can add this to a menu, key binding, etc. You can kill stop a running instance of \fIFvwmEvent\fP with: .sp .if n .RS 4 .nf .fam C KillModule FvwmEvent Alias .fam .fi .if n .RE .SH "CONFIGURATION OPTIONS" .sp \fIFvwmEvent\fP gets config info from \fBfvwm\fP\*(Aqs module configuration database (see \fIfvwm\fP(1), section \fBMODULE COMMANDS\fP), and looks for certain configuration options: .sp *FvwmEvent: Cmd command .RS 4 This determines the \fIfvwm\fP function that is to be called with the event parameters. You might want to do one of the following (details below): .sp .if n .RS 4 .nf .fam C # execute distinct fvwm functions *FvwmEvent: Cmd # execute distinct external programs *FvwmEvent: Cmd exec .fam .fi .if n .RE .sp \fIFvwmEvent\fP has support for any other external program. e.g: the rsynth \*(Aqsay\*(Aq command: .sp .if n .RS 4 .nf .fam C *FvwmEvent: Cmd "Exec /rsynth/say" *FvwmEvent: destroy_window "window closed" .fam .fi .if n .RE .sp You can also use \fIfvwm\fP\*(Aqs builtin \fIEcho\fP command as \fIFvwmEvent: Cmd\fP to obtain debug output for \fIfvwm\fP events quietly. I used this setup to debug FvwmAuto: .sp .if n .RS 4 .nf .fam C *FvwmEvent: Cmd Echo *FvwmEvent: focus_change "focus change" *FvwmEvent: raise_window "raise window" .fam .fi .if n .RE .sp You can even call different shell commands for each event just by setting .sp .if n .RS 4 .nf .fam C *FvwmEvent: Cmd exec *FvwmEvent: add_window \*(Aqkillname "APPL ERROR"\*(Aq .fam .fi .if n .RE .RE .sp *FvwmEvent: PassId .RS 4 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\(cqs are strings. .RE .sp *FvwmEvent: window\-manager\-event action .RS 4 Binds particular actions to window manager events. The action is appended to the \fICmd\fP which is then sent to \fIfvwm\fP for execution. .sp The following events are valid: .TS allbox tab(:); lt lt. T{ .sp \fIEvent\fP T}:T{ .sp \fIDescription\fP T} T{ .sp add_window T}:T{ .sp Occurs when a new window is mapped and visible T} T{ .sp config_info T}:T{ .sp Occurs when a module asks for configuration T} T{ .sp configure_window T}:T{ .sp Occurs when a ConfigureNotify event happens T} T{ .sp default_icon T}:T{ .sp Occurs when a window\(cqs DefaultIcon changes T} T{ .sp deiconify T}:T{ .sp Occurs when a window id deiconified T} T{ .sp destroy_window T}:T{ .sp Occurs when a window is destroyed T} T{ .sp dewindowshade T}:T{ .sp Occurs when a window is unshaded T} T{ .sp echo T}:T{ .sp Occurs when an Echo command is run T} T{ .sp end_config_info T}:T{ .sp Occurs when there\(cqs no more module config to send T} T{ .sp end_windowlist T}:T{ .sp Occurs when the windowlist has finished sending T} T{ .sp enter_window T}:T{ .sp Occurs when a window receives a EnterNotify event T} T{ .sp error T}:T{ .sp DEPRECATED T} T{ .sp focus_change T}:T{ .sp Occurs when a window gains or loses focus T} T{ .sp icon_file T}:T{ .sp DEPRECATED T} T{ .sp icon_location T}:T{ .sp DEPRECATED T} T{ .sp icon_name T}:T{ .sp DEPRECATED T} T{ .sp iconify T}:T{ .sp Occurs when a window is iconified T} T{ .sp leave_window T}:T{ .sp Occurs when a window receives a LeaveNotify event T} T{ .sp lower_window T}:T{ .sp Occurs when a window is lowered T} T{ .sp map T}:T{ .sp Occurs when a window is Mapped T} T{ .sp mini_icon T}:T{ .sp Occurs when a window\(cqs mini icon changes T} T{ .sp monitor_changed T}:T{ .sp Occurs when a monitor\(cqs resolution changes T} T{ .sp monitor_disabled T}:T{ .sp Occurs when a monitor is disabled (via RandR) T} T{ .sp monitor_enabled T}:T{ .sp Occurs when a monitor is enabled (via RandR) T} T{ .sp monitor_focus T}:T{ .sp Occurs when a monitor gains focus T} T{ .sp new_desk T}:T{ .sp Occurs when a new desk is switched to T} T{ .sp new_page T}:T{ .sp Occurs when a new page is switched to T} T{ .sp old_add_window T}:T{ .sp DEPRECATED T} T{ .sp old_configure_window T}:T{ .sp DEPRECATED T} T{ .sp property_change T}:T{ .sp Occurs when a window receives a PropertNotify event T} T{ .sp raise_window T}:T{ .sp Occurs when a window is raised T} T{ .sp res_class T}:T{ .sp Occurs when a window\(cqs Class is set T} T{ .sp res_name T}:T{ .sp Occurs when a window\(cqs Resource is set T} T{ .sp restack T}:T{ .sp Occurs when windows are restacked T} T{ .sp sendconfig T}:T{ .sp Occurs when FvwmEvent asks for its config T} T{ .sp shutdown T}:T{ .sp DEPRECATED T} T{ .sp startup T}:T{ .sp DEPRECATED T} T{ .sp string T}:T{ .sp Occurs when the SendToModule command is used T} T{ .sp unknown T}:T{ .sp DEPRECATED T} T{ .sp visible_icon_name T}:T{ .sp Occurs when a window\(cqs visible icon name changes T} T{ .sp visible_name T}:T{ .sp Occurs when a window\(cqs visible name changes T} T{ .sp window_name T}:T{ .sp Occurs when a window\(cqs name (WM_NAME) is set T} T{ .sp windowshade T}:T{ .sp Occurs when a window is shaded T} .TE .sp .sp 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. .sp The monitor_* events do not operate in a window context (as there isn\(cqt one). .sp The given event command is also passed the following values: .sp .if n .RS 4 .nf .fam C $0: monitor_event_name (for example: monitor_changed) $1: monitor_name (the RandR name of the monitor) .fam .fi .if n .RE .sp For example, consider the following: .sp .if n .RS 4 .nf .fam C DestroyFunc RandRFunc AddToFunc\& RandRFunc + I Exec exec xmessage "Monitor $1 had this event: $0" DestroyModuleConfig FE\-Monitor: * *FE\-Monitor: monitor_changed RandRFunc *FE\-Monitor: monitor_enabled RandRFunc KillModule FvwmEvent FE\-Monitor Module FvwmEvent FE\-Monitor .fam .fi .if n .RE .sp When, say, the monitor_changed event is triggered, RandRFunc is run, with the monitor name passed in as the first argument, and the monitor event as the second argument. In this way it is possible to do further matching if required. .sp \fBNOTE\fP: Using \f(CRPassID\fP with a configuration which includes monitor_ lines won\(cqt work since there is no ID to pass back. If \f(CRPassID\fP is still required, separate out monitor events into their own FvwmEvent configuration. .sp The echo event is generated whenever Fvwm receives an Echo command. .sp Note: The enter_window event is generated when the pointer enters a window. With the \-passid option, that window\(cqs 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. .sp Note: When the shutdown event arrives, FvwmEvent may be killed before it can trigger the associated action. .RE .sp *FvwmEvent: Delay 5 .RS 4 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. .RE .sp *FvwmEvent: StartDelay delay .RS 4 Specifies that an event\-action will only be executed if it occurs at least \fIdelay\fP seconds after the startup event. Events that occur during the delay period are ignored. This option is useful when \fIfvwm\fP starts and restarts using an audio player. The default delay is 0. .RE .SH "HISTORY" .sp This module has evolved of \fIFvwmAudio\fP, which in term is heavily based on a similar Fvwm module called \fIFvwmSound\fP by Mark Boyns. \fIFvwmAudio\fP simply took Mark\(cqs 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, \fIFvwmEvent\fP took this one step further and now calls any \fIfvwm\fP function. If \fIfvwm\fP\*(Aqs Exec function is used, any external program can be called with any parameter. .SH "AUTHORS" .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} 1994 FvwmSound Mark Boyns (\c .MTO "boyns\(atsdsu.edu" "" ")" .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} 1994 FvwmAudio Mark Scott (\c .MTO "mscott\(atmcd.mot.com" "" ")" .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} 1996 FvwmAudio Albrecht Kadlec .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} 1998 FvwmEvent Albrecht Kadlec (\c .MTO "albrecht\(atauto.tuwien.ac.at" "" ")" .RE