Skip to content

Gnoblin Lifecycle Events ​

Observe lifecycle changes for Gnoblin capabilities, configuration, runtime, appearance, and session state.

Gnoblin event payloads follow the current Gnoblin runtime API.

Gnoblin ​

The native window.* lifecycle events require the direct Mutter runtime.

Every Lua event record includes name. The table below lists event-specific fields.

Window event records also include revision, sequence, and monotonic time. Nested window and last records carry their own revision, matching the event revision.

Values with defined choices ​

  • Session state is starting, running, or stopping.
  • Runtime state is starting, running, restarting, or unavailable.
  • Lock state is unlocked, covering, locked, or failsafe; only locked confirms that Mutter completed the transition.
  • Color scheme is default, prefer-dark, or prefer-light.
  • Operation ok is a boolean. Successful events include value; failures include an Error record.

Other event fields are snapshots or values supplied by their source. The shared type reference defines the Gnoblin records used in these payloads.

Event nameFieldsDispatched when
gnoblin.session.lock-state-changedstate, revision, sequence, timeMutter reports a lock-state transition in a native session.
gnoblin.session.state-changedstate, revision, sequence, timeThe session moves from starting to running or stopping, or from running to stopping. Only in a session started by Gnoblin's supervisor.
gnoblin.runtime.status-changedstate, generation, sequence, timeThe worker state or accepted runtime generation changes; matches gnoblin.runtime.status().
gnoblin.config.reloadedpath, revision, warnings, sequence, timeThe candidate config commits. See reload warnings for diagnostic strings.
gnoblin.config.reload-failedpath, error, sequence, timeCandidate loading, validation, or apply fails while the active runtime stays available.
gnoblin.workspace.createdworkspaceA runtime workspace is created.
gnoblin.workspace.renamedworkspaceA workspace display name changes.
gnoblin.workspace.changedworkspace, changedIts position, window count, or persistence state changes.
gnoblin.workspace.removedworkspace_id, lastA temporary workspace is removed.
gnoblin.workspace.activatedworkspace, optional previous_idThe active workspace changes.
gnoblin.workspace.window-movedwindow_id, from_id, to_idA window moves from one workspace to another.
gnoblin.monitor.addedmonitorAn active logical monitor appears in the native runtime.
gnoblin.monitor.changedmonitor, changedA listed monitor property changes; changed names the changed properties.
gnoblin.monitor.removedmonitor_id, lastAn active logical monitor is removed.
gnoblin.monitor.privacy-screen-changedrequested_enabled, source, revision, monitors, sequence, timeThe effective request, its source, or a monitor's privacy-screen state changes.
gnoblin.layer.createdlayerA layer-shell surface appears in the published snapshot.
gnoblin.layer.changedlayer_id, layer, changedA published layer record changes, including mapped or unmapped transitions.
gnoblin.layer.removedlayer_id, lastA layer-shell surface disappears from the published snapshot.
gnoblin.input.device-addeddeviceAn input device appears in the native runtime.
gnoblin.input.device-removeddevice_id, lastAn input device is removed from the native runtime.
gnoblin.input.sources-changedsourcesThe configured, available XKB source list changes.
gnoblin.input.source-changedavailable, optional sourceMutter confirms a different Gnoblin-owned keymap group, or the current source becomes unknown.
gnoblin.input.orientation-lock-changedavailable, locked, orientation, source, revision, sequence, timeOrientation-lock state or its source changes.
gnoblin.input.gesturegesture, phase, fingers, sequence, time, and gesture-specific fieldsA touchpad gesture phase reaches the standalone native Lua runtime.
gnoblin.launch.changedlaunchA native launch-feedback record is created or changes state.
gnoblin.portal.grant-addedgrant, revision, sequence, timeA validated persistent portal grant is added or updated.
gnoblin.portal.grant-removedgrant_id, kind, revision, sequence, timeA persistent portal grant is revoked.
gnoblin.privacy.changedstate, revision, sequence, timeA monitored privacy activity changes; state is a PrivacyState snapshot.
gnoblin.location.authorization-requestedrequest_id, app_id, requested_accuracy, expires_at_us, sequence, timeGeoClue asks Gnoblin to authorize an application's location request.
gnoblin.auth.requestedrequest_id, action_id, message, icon_name, details, identities, sequence, timeA program asks the session's polkit agent for authentication.
gnoblin.auth.promptrequest_id, prompt, echo, sequence, timeThe authentication check needs input from the user.
gnoblin.auth.messagerequest_id, text, error, sequence, timeThe authentication check has a line of text for the user.
gnoblin.auth.finishedrequest_id, result, sequence, timeAn authentication request ends.
gnoblin.prompt.requestedrequest_id, kind, title, message, description, warning, password_new, choice_label, caller_window, continue_label, cancel_label, sequence, timeA keyring or GPG prompt asks for a password or a confirmation.
gnoblin.prompt.finishedrequest_id, result, sequence, timeA keyring or GPG prompt ends.
gnoblin.capability.changedcapability, revision, sequence, timeA native capability changes; capability is the updated Capability record.
gnoblin.appearance.color-scheme-changedcolor_scheme (default, prefer-dark, prefer-light), sequence, timeThe desktop color-scheme preference changes.
gnoblin.window.createdwindowThe native compositor runtime observes a new managed window.
gnoblin.window.changedwindow_id, changed, windowA mapped window property changes in the native compositor runtime.
gnoblin.window.focusedwindow_id, windowA window gains keyboard focus in the native compositor runtime.
gnoblin.window.unfocusedwindow_id, windowA window loses keyboard focus in the native compositor runtime.
gnoblin.window.attention-changedwindow_id, window, demands_attentionMutter's attention state changes.
gnoblin.window.activation-deniedwindow_id, reasonStrict focus policy denies an application's activation request.
gnoblin.window.closedwindow_id, lastThe native compositor runtime removes a managed window.
gnoblin.focus.policy-changedpolicy, revision, sequence, timeThe effective focus policy changes after a successful config commit.
gnoblin.permission.changedpolicy, revision, sequence, timeThe committed portal permission policy changes after a successful config commit.
gnoblin.shortcut.activatedshortcut, trigger, focus_contextA configured native command shortcut is activated by a trusted key press in the native runtime.
gnoblin.shortcut.binding-activatedid, accelerator, trigger, first, modifiers, time, focus_contextA Lua-registered dynamic shortcut activates. Only the first activation can carry focus authority.
gnoblin.shortcut.binding-deactivatedid, accelerator, input_timeA press-triggered dynamic shortcut is physically released.
gnoblin.shortcut.session.activatedid, session_id, first, trigger, modifiers, timeA held dynamic shortcut starts or repeats its modal session.
gnoblin.shortcut.session.keyid, session_id, key fields, optional focus_contextA modal key event; real, non-repeat input may carry one-use focus authority.
gnoblin.shortcut.session.endedid, session_id, reason, timeA held shortcut session ends or is cancelled.
gnoblin.osd.requestedmonitor_id, output_names?, icon?, label?, sequence, timeMutter requests an OSD; a shell decides whether and how to display it.
gnoblin.pointer.locate-requestedx, y, monitor_id?, output_names?, sequence, timeThe user pressed the locate-pointer key; a listener shows the pointer.
gnoblin.animation.startedanimation, target, event, cancelledA configured window or layer animation, workspace transition, or preview starts.
gnoblin.animation.finishedanimation, target, event, cancelledA configured window or layer animation, workspace transition, or preview completes or stops.
gnoblin.operation.completedoperation_id, method, ok, value or error, revision, sequence, timeAn asynchronous operation completes; error is an Error record.

Reloads and appearance ​

When reload requests overlap, inspect their Operation results. Gnoblin emits no separate event.

gnoblin.appearance.color-scheme-changed fires after the desktop color-scheme preference changes. It does not report the initial value. The preference is color-scheme in org.gnome.desktop.interface. Read the current value with gnoblin.appearance.color_scheme(); it returns nil if the schema or key is unavailable.

lua
gnoblin.on("gnoblin.appearance.color-scheme-changed", function(event)
    print("Desktop color scheme: " .. event.color_scheme)
end)