Lua's require() caches modules in package.loaded; without explicit invalidation, changes to default/hypr/*.lua or ~/.config/hypr/*.lua won't take effect after hyprctl reload even though hyprland.lua itself re-runs. The clear runs unconditionally — benefits both dev-link workflows (checkout files re-evaluate after every reload) and normal users who edit their own ~/.config/hypr/*.lua and run omarchy-restart-hyprctl. Cost is negligible: package.loaded has a handful of entries. Pattern matches the require_all.lua reload option (which sets package.loaded[module] = nil before require()), but applied broadly to the omarchy module namespace at the entry point so individual modules don't need to opt in.
36 lines
1.2 KiB
Lua
36 lines
1.2 KiB
Lua
-- Learn how to configure Hyprland: https://wiki.hypr.land/Configuring/Start/
|
|
|
|
-- Force re-evaluation of Omarchy modules on every hyprctl reload. Lua caches
|
|
-- already-required modules in package.loaded, so without this clear, changes
|
|
-- to default/hypr/*.lua (and user ~/.config/hypr/*.lua) in a checkout wouldn't
|
|
-- take effect after `hyprctl reload` even though hyprland.lua re-runs.
|
|
-- Cheap: package.loaded is small.
|
|
for k in pairs(package.loaded) do
|
|
if k:match("^default%.hypr") or k:match("^hypr%.") then
|
|
package.loaded[k] = nil
|
|
end
|
|
end
|
|
|
|
-- Load user modules from ~/.config and Omarchy defaults from $OMARCHY_PATH.
|
|
package.path = os.getenv("HOME")
|
|
.. "/.config/?.lua;"
|
|
.. (os.getenv("OMARCHY_PATH") or (os.getenv("HOME") .. "/.local/share/omarchy"))
|
|
.. "/?.lua;"
|
|
.. package.path
|
|
|
|
-- All Omarchy default setups
|
|
require("default.hypr.omarchy")
|
|
|
|
-- Change your own setup in these files and override defaults.
|
|
require("hypr.monitors")
|
|
require("hypr.input")
|
|
require("hypr.bindings")
|
|
require("hypr.looknfeel")
|
|
require("hypr.autostart")
|
|
|
|
-- Toggle config flags dynamically.
|
|
require("default.hypr.toggles")
|
|
|
|
-- Add any other personal Hyprland configuration below.
|
|
-- o.window("qemu", { workspace = "5" })
|