Widget Loading¶
Bootstrap begins in runtime.lua.
Flow¶
- resolve widget directory
- load runtime modules
- call
loader.load_widgets(...)
Inside loader.lua:
- list
*.luafiles - sort deterministically
- create isolated environment per file
- inject scoped
easybarAPI - execute file
Important details¶
- each widget has isolated defaults
- all widgets share one runtime registry
- every
*.luafile in the widget directory is loaded - reload is a full reset
Public widget API shape¶
Lua widget authors use node handles.
easybar.add(...) creates one node and returns its handle:
local clock = easybar.add(easybar.kind.item, "clock", {
position = "right",
order = 10,
label = os.date("%H:%M"),
})
The returned handle owns node operations:
node.idnode.namenode:set(props)node:get()node:remove()node:subscribe(events, handler)
Example:
clock:subscribe(easybar.events.minute_tick, function()
clock:set({
label = os.date("%H:%M"),
})
end)
Internally, api.lua still delegates to the registry and subscription modules by id.
The id-based functions are internal implementation details, not the public widget-author API.