Gnoblin

Lua event handlers

Put live compositor behavior in Lua modules loaded by your Gnoblin configuration.

Create ~/.config/gnoblin/scripts/window-log.lua:

Lua
gnoblin.on("gnoblin.window.created", function(event)
    local window = event.window
    print(window.app_id, window.title)
end)

Load the module from ~/.config/gnoblin/init.lua:

Lua
gnoblin.load("scripts/**/*.lua")

Run gnoblinctl config reload to activate it. The runtime replaces the callbacks after a successful reload; a failed reload leaves the active config running. See the event reference for event names and payload fields, and the Lua runtime API for operations that control windows, workspaces, input, and session state.

Lua configuration runs in a restricted runtime. It cannot access arbitrary files, start processes, load native modules, or reach internal compositor objects. Use configured shortcuts or autostart entries to launch programs. Panels, launchers, notifications, and other visible UI belong in separate Wayland clients; Lua supplies their compositor state and control API.

Esc

Try