Fix current theme state migration

This commit is contained in:
David Heinemeier Hansson
2026-06-20 14:36:27 +02:00
parent a2620e2fe0
commit c62108fa0b
4 changed files with 109 additions and 0 deletions
+26
View File
@@ -1,6 +1,32 @@
-- Hyprland bootstrap for Omarchy's Lua module path.
local home = os.getenv("HOME")
local reload_prefixes = {
"default.hypr",
"hypr",
"omarchy.current.theme",
}
local function should_reload_module(module)
for _, prefix in ipairs(reload_prefixes) do
if module == prefix or module:sub(1, #prefix + 1) == prefix .. "." then
return true
end
end
return false
end
local modules_to_reload = {}
for module in pairs(package.loaded) do
if should_reload_module(module) then
table.insert(modules_to_reload, module)
end
end
for _, module in ipairs(modules_to_reload) do
package.loaded[module] = nil
end
-- Load generated state from ~/.local/state, user modules from ~/.config, and
-- Omarchy defaults from $OMARCHY_PATH.