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:
1 parent
9dca02a985
commit
2e75be49f4
1 file changed
+21
-15
@@ -57,23 +57,29 @@ in {
|
|||||||
extraLuaFiles."00-dms" = {
|
extraLuaFiles."00-dms" = {
|
||||||
autoLoad = true;
|
autoLoad = true;
|
||||||
content = ''
|
content = ''
|
||||||
-- DMS setup/runtime owns these modules. Load only the Lua equivalents
|
-- DMS setup/runtime owns these modules. Load the Lua equivalents of
|
||||||
-- of the pre-migration active sources, before local Home Manager
|
-- the pre-migration active sources (colors, layout, outputs) plus the
|
||||||
-- settings, preserving the old source-first order without enabling new
|
-- user-managed binds-user and windowrules, before local Home Manager
|
||||||
-- DMS default binds or rules.
|
-- 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
|
-- Keep fresh Home Manager generations usable before DMS has written
|
||||||
-- ~/.config/hypr/dms/*.lua.
|
-- ~/.config/hypr/dms/*.lua: each require is guarded by
|
||||||
local function require_if_present(module)
|
-- package.searchpath. Hyprland's safeLuaRequire would swallow a
|
||||||
if package.searchpath(module, package.path) ~= nil then
|
-- missing module silently, but the guards keep `hyprctl
|
||||||
require(module)
|
-- configerrors` clean.
|
||||||
end
|
--
|
||||||
end
|
-- IMPORTANT: keep every require call as a literal single-line
|
||||||
|
-- statement. DMS detects inclusion via a static text scan
|
||||||
require_if_present("dms.colors")
|
-- (dms config resolve-include, regex: word-boundary require
|
||||||
require_if_present("dms.layout")
|
-- followed by a quoted module name) and does NOT follow wrapper
|
||||||
require_if_present("dms.outputs")
|
-- functions like require_if_present — hiding the calls behind a
|
||||||
require_if_present("dms.binds-user")
|
-- 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 = {
|
settings = {
|
||||||
|
|||||||
Reference in new issue
Block a user