What it does
desktop_config
Layout config for the desktop shell UI. Holds the shortcut definitions, the virtual filesystem tree shown by My Computer, and shared constants (taskbar height, default icons, double-click window). Pure data with a single lookup helper; no engine calls, no module state.
Exports
M.findShortcut(shortcutId: string) -> Shortcut?— linear-scanM.SHORTCUTSfor the matching entry; returnsnilif no shortcut has that id.M.SHORTCUTS: { Shortcut }— ordered desktop shortcut definitions (id, label, icon, position, optionalworld/action).M.VFS: { [string]: { VfsEntry } }— virtual filesystem tree keyed by path ("/","/apps","/home", ...).M.TASKBAR_HEIGHT: number,M.DOUBLE_CLICK_WINDOW_SECONDS: number,M.ICON_FOLDER: string,M.ICON_FILE: string— shared layout/icon constants.
Types:
Shortcut = { id, label, icon, icon_src, kind, x, y, width, height, world?, action? }VfsEntry = { name, kind, icon_src?, content?, world?, app_id? }
Usage
local DesktopConfig = require("@builtin::modules.desktop_config")
for _, shortcut in ipairs(DesktopConfig.SHORTCUTS) do
print(shortcut.id, shortcut.label)
end
local entry = DesktopConfig.findShortcut("my_computer")
Notes
- Tables on
Mare mutable references — callers can patch them at boot before the desktop shell renders, but mutating them at runtime won't re-render anything on its own. findShortcutis a linear scan overM.SHORTCUTS; fine for the current ~9-entry list, not a hot-path helper.M.VFSis keyed by normalised path (no trailing slash except for/); consumers should normalise lookups viapath_utils.normalizePath.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.