Skip to content

files_and_load_order ​

Configuration reference

Start with one init.lua. Split it into modules when that makes it easier to read.

Which file is loaded? ​

gnoblinctl config path prints the main config file used by your running session.

The usual path is ~/.config/gnoblin/init.lua, or $XDG_CONFIG_HOME/gnoblin/init.lua when that variable is set. The compositor's GNOBLIN_CONFIG environment variable overrides it.

Without that override, Gnoblin checks init.lua, then the old gnoblin.toml and gnoblin.conf names. Those names are detected only so Gnoblin can report that the file must be converted; TOML and CONF are not parsed. Rename or remove an old file after converting it to Lua. Every selected root and included configuration file must use the .lua suffix.

When no user config exists, the session supervisor loads the starter Lua configuration embedded in the binary. Run gnoblinctl init to create an editable copy at the selected config path. The command leaves existing files unchanged. Setting GNOBLIN_CONFIG in a terminal does not change the environment of an already-running compositor.

Include a file ​

lua
gnoblin.load("appearance.lua")

The path is relative to the calling file. Absolute and ~/ paths also work. The included file uses the same API:

lua
gnoblin.configure {
    window_management = {focus_mode = "hover"},
}

Include a directory ​

lua
gnoblin.load("conf.d/**/*.lua")

Matching files load in filename order (byte order, independent of your language settings). Use numbered names such as 10-appearance.lua and 90-local.lua to make the order predictable.

  • *, ? and [abc] match within one path segment.
  • ** also searches subdirectories, without following directory symlinks.
  • Hidden names need an explicit dot in the pattern.
  • An unmatched glob is allowed; a missing exact filename is an error.

Files and searched directories are watched, including newly added matches.

Override or append? ​

Put gnoblin.load(...) calls before your personal settings so your changes are applied last.

Repeated gnoblin.configure calls keep settings you have not changed:

lua
gnoblin.configure {window_management = {focus_mode = "hover"}}
gnoblin.configure {window_management = {raise_on_click = true}}

The result keeps sloppy focus and raises windows when clicked. The second call does not remove settings that it does not mention.

Lists replace earlier values. This applies to window_rules, shortcuts, and autostart.

To add a window rule while keeping previous rules, use:

lua
gnoblin.window_rule {
    match = {type = "window", focused = false},
    opacity = 0.95,
}

The shortcuts and autostart maps merge entries with the same name. Set an entry's enable field to false to disable an imported shortcut or autostart. Disabling an autostart entry does not stop a running process.

To remove every shortcut loaded so far:

lua
gnoblin.configure {shortcuts = {}}

Use gnoblin.configure.shortcuts to add or change individual shortcuts without clearing the others.

Use a Lua module ​

Use a module when you want a file to return settings for another file to use. For ordinary config files, gnoblin.load is enough.

In appearance.lua:

lua
return {window_management = {focus_mode = "hover"}}

In init.lua:

lua
gnoblin.configure(require("appearance"))

require("appearance") searches appearance.lua, then lua/appearance.lua, relative to its caller. It runs once per reload.

Returning a table does not apply its settings by itself. Pass it to gnoblin.configure as shown above.

Dots in module names are not converted to directories. For explicit subdirectories, use gnoblin.load("parts/motion.lua"). Avoid loading the same file through both a glob and require.

Available Lua functions ​

gnoblin is available globally in every loaded file and module. See the function reference.

Setting names use snake_case. The API converts them to Gnoblin's internal hyphenated names. String values, shader uniform names and renderer names stay literal. Do not supply both spellings of the same key in one table.

Each reload evaluates the files again; Lua variables do not survive it.

Config code can use Lua's table, string, math and UTF-8 helpers. It cannot read arbitrary files, run processes or load native modules. These are not available:

  • The os, io, debug and package libraries. os.getenv("HOME") fails with "attempt to index a nil value (global 'os')".
  • dofile and loadfile. To load another file, use gnoblin.load.

To launch programs, use shortcuts or autostart.

Evaluation is limited to 8 MiB of Lua memory, one million instructions and 32 nested files.

For event-driven compositor behavior, load a Lua module that registers a callback with gnoblin.events.on. See Lua event handlers and the event reference. Keep presentation in separate Wayland clients; the runtime API controls compositor state.

Reload and persistence ​

ChangeAppliesWhen removed
Rules and animationsOn reloadEarlier rules/defaults apply
Titlebar policyAfter reload and the app's next surface updateEarlier rules/defaults apply
Command shortcutsOn reloadBinding released; launched process stays
Built-in keybindingsOn reloadBuilt-in default applies
Window-management preferencesOn reloadGnoblin default applies
Compositor interaction preferencesOn reloadGnoblin default applies
Input preferencesOn reloadGNOME/Mutter settings apply
Input sourcesOn reloadGNOME session sources apply
Orientation lockOn reloadGNOME orientation setting applies
Cursor theme and sizeOn reloadAdwaita at 24 logical pixels
Notifications and layout popupOn reloadSaved GSettings value stays
AutostartReconciled on reloadUpdated or removed child stops
Renderer servicesRestart on reloadEnabled frames use native fallback
ProtocolsOn reload for new clientsDefault on reload for new clients
Launcher focus behaviourOn reloadDefault on reload
Drag boundaryNext drag after reloadDefaults to enabled
Portal routesPortal service restarts on reloadActive portal requests may be interrupted
Xwayland server flagsXwayland restarts when flags changeRunning X11 apps disconnect

If you change a setting with the CLI, a value written in your config file will replace that change on the next config reload.

gnoblinctl config reload replaces the active Lua configuration and its event callbacks. It does not replace native libraries or restart separate desktop clients.