fix(hyprland): make dms module requires detectable by DMS

DMS detects config inclusion via a static text scan (dms config
resolve-include, regex matches literal require("name") calls only).
The require_if_present wrapper hid every dms.* module from that scan,
so DMS reported included:false for all files even though Hyprland
loaded them fine (colors/binds-user/outputs were verifiably active).

Replace the wrapper with guarded single-line literal requires and add
dms.windowrules (user-managed DMS window rules, e.g. vibe-typer size
and com.danklinux.dms float) to the load list.
This commit is contained in:
m3ta-chiron committed 2026-09-28 18:13:14 +02:00
1 parent 9dca02a985
commit 2e75be49f4
1 file changed
+21 -15
+21 -15
View File
@@ -57,23 +57,29 @@ in {
extraLuaFiles."00-dms" = {
autoLoad = true;
content = ''
-- DMS setup/runtime owns these modules. Load only the Lua equivalents
-- of the pre-migration active sources, before local Home Manager
-- settings, preserving the old source-first order without enabling new
-- DMS default binds or rules.
-- DMS setup/runtime owns these modules. Load the Lua equivalents of
-- the pre-migration active sources (colors, layout, outputs) plus the
-- user-managed binds-user and windowrules, before local Home Manager
-- settings, preserving the old source-first order without enabling
-- DMS default binds (dms.binds stays unloaded).
--
-- Keep fresh Home Manager generations usable before DMS has written
-- ~/.config/hypr/dms/*.lua.
local function require_if_present(module)
if package.searchpath(module, package.path) ~= nil then
require(module)
end
end
require_if_present("dms.colors")
require_if_present("dms.layout")
require_if_present("dms.outputs")
require_if_present("dms.binds-user")
-- ~/.config/hypr/dms/*.lua: each require is guarded by
-- package.searchpath. Hyprland's safeLuaRequire would swallow a
-- missing module silently, but the guards keep `hyprctl
-- configerrors` clean.
--
-- IMPORTANT: keep every require call as a literal single-line
-- statement. DMS detects inclusion via a static text scan
-- (dms config resolve-include, regex: word-boundary require
-- followed by a quoted module name) and does NOT follow wrapper
-- functions like require_if_present — hiding the calls behind a
-- helper made DMS report all dms modules as not included.
if package.searchpath("dms.colors", package.path) then require("dms.colors") end
if package.searchpath("dms.layout", package.path) then require("dms.layout") end
if package.searchpath("dms.outputs", package.path) then require("dms.outputs") end
if package.searchpath("dms.binds-user", package.path) then require("dms.binds-user") end
if package.searchpath("dms.windowrules", package.path) then require("dms.windowrules") end
'';
};
settings = {