Skip to content

Lua Runtime API ​

Use the Lua runtime API to read compositor state, handle events, and request session actions from a shell integration.

The supervised Lua runtime is available in the standalone Gnoblin session. Its API version is 1.81 in the current source. Callback code runs outside Mutter's compositor thread; keep event callbacks short and nonblocking.

API domains ​

Shared conventions ​

Read-only calls return detached snapshots. Runtime mutations return an Operation handle and complete asynchronously. See Errors and results and shared runtime types.

Subscribe with gnoblin.events.on(name, callback) or the gnoblin.on alias. See the event reference.

The local socket protocol for non-Lua clients is documented in the compositor bridge. For command-line use, see gnoblinctl.

Runtime identity and settings ​

gnoblin.settings is an immutable snapshot of active configuration values. Setting names use public snake_case, and revision identifies the committed snapshot. It becomes available after the initial configuration commits.

lua
local focus_mode = gnoblin.settings.window_management.focus_mode
print(focus_mode, gnoblin.settings.revision)

gnoblin.snapshot() returns a detached copy of the Lua configuration view. Use gnoblin.settings for immutable reads of committed settings.

gnoblin.version() returns an immutable record with string fields gnoblin, gnome, mutter, lua, api, git_remote, git_sha, and build_id. Missing values are returned as "unknown". User information, query strings, and fragments are removed from remote URLs.

Gnoblin reads share/gnoblin/version.ini. Set GNOBLIN_VERSION_METADATA_FILE to select another file. If it is unset or unreadable, Gnoblin checks the executable's installation prefix and then the system XDG data directories.