FvwmMFL - Man Page

the Fvwm3 front-loader module

Synopsis

FvwmMFL can only be invoked by Fvwm3. Command line invocation of the FvwmMFL will not work.

This module has no command-line options.

Description

The FvwmMFL module provides access to Fvwm events over a unix-domain socket. This module is intended to provide externally-written programs (clients) the ability to receive information from Fvwm and to perform an action on that event.

The information from Fvwm3 is in the form of JSON packets. Each JSON packet has different fields, depending on the type requested.

Communication

The default unix-domain socket for FvwmMFL is $TMPDIR/fvwmmfl/fvwm_mfl$DISPLAY.sock_.

The path for where fvwm_mfl-$DISPLAY.sock is created can be changed by setting the FVWMMFL_SOCKET_PATH environment variable.  FvwmMFL will create this if it does not exist, and set relevant permissions.

Registering Interest

Commands can be sent to FvwmMFL to control which information is sent the client. The set command is used for this. The table below shows which events can be subscribed to.

EventDescription
new_windowFired when a new window is mapped and visible.
mapFired when a window is mapped.
configure_windowFired when a window is moved or resized.
destroy_windowFired when a window is closed.
new_pageFired when a new page is switched to.
new_deskFired when a new desk is switched to.
raise_windowFired when a window is raised (or changes layer).
lower_windowFired when a window is lowered (or changed layer).
focus_changeFired when a window loses/gains focus.
enter_windowFired when a window has the pointer moved into it.
leave_WindowFired when a window has pointer moved out of it.
window_shadeFired when a window is shaded.
window_unshadeFired when a window is unshaded.
window_nameFired when the window name changes.
visible_nameFired when the visible window name changes.
res_classFired when the class of the window is set.
res_nameFired when the resource of the window is set.
iconifyFired when a window is iconified.
deiconifyFired when a window is deiconified.
icon_nameFired when the icon name changes.
visible_icon_nameFired when the icon’s visible name changes.
icon_fileFired when the path to the icon changes.
icon_locationFired when the icon location changes.
restackFired when the window stacking order changes.
echoFired when Fvwm receives an Echo command.

For example, to register an interest in new_window and focus_change, the following commands would be set via the socket:

set new_window
set focus_change

To remove interest in an event, use the unset command:

unset focus_change

JSON Format

Each packet sent to a client is in plain JSON. The information contained in each packet varies depending on the event.

TODO: document each JSON structure.

Example

The following example shows how to monitor for focus_change events at the shell, printing the JSON returned:

  echo set focus_change | nc -U /tmp/fvwm_mfl.sock 2>&1 | jq --unbuffered

Outputs:

{ "focus_change": { "window": "0x5400022", "type": 0, "hilight": {
"text_colour": 16777215, "bg_colour": 32767 } } }

Authors

This module first appeared in 2020.

Info

2025-01-16 Fvwm Modules