Skip to main content

Module plugin

Module plugin 

Source
Expand description

The conversation between mochid and a plugin backend.

mochid starts the backend with one end of a socket pair as the file descriptor named by FD_ENV, and the same JSON lines as the main socket go over it: mochid sends ToPlugin, the backend sends FromPlugin. mochid speaks first, with hello; the backend answers with its own hello, then runs until mochid closes the socket.

The messages mirror a builtin module’s ModuleCtx, one message per call. The backend numbers its activities and bubbles itself, from 1, and events about them use its numbers. Requests that expect an answer carry an id the answer repeats.

Structs§

CompositorState
The compositor’s state, as ModuleCtx::compositor gives builtins.
OutputInfo
A monitor.
WindowInfo
A window on a visible workspace.
WorkspaceInfo
A workspace.

Enums§

FromPlugin
Sent by a plugin backend to mochid.
ToPlugin
Sent by mochid to a plugin backend.

Constants§

DIR_ENV
The environment variable holding the plugin’s directory, where its manifest is. The backend also starts there.
FD_ENV
The environment variable holding the backend’s end of the socket, as a file descriptor number: always 3.