fix(hyprland): remove enable override, use workspace_rule and table-based window_rule syntax
- Remove redundant `enable = true` from host hyprland blocks to avoid
circular module reference (Hyprland is already enabled via m3ta-home
profile flags; these files only add host-specific settings)
- Replace legacy string-format `workspace = ["1, monitor:..."]` entries
with proper `workspace_rule` attrsets (e.g. `{ workspace = "1";
monitor = "DP-1"; default = true; }`) per current Hyprland Lua docs
- Replace `_args + mkLuaInline hl.dsp.window.match(...)` window_rule
pattern with clean single-table `{ match.class = "..."; effect; }`
attrsets per Home Manager module examples
- Keep `configType = "lua"` and monitor table syntax unchanged
This commit is contained in:
+45
-68
@@ -39,11 +39,10 @@ with lib; {
|
||||
# ── Hyprland monitor layout ──
|
||||
(mkIf config.wayland.windowManager.hyprland.enable {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
configType = "lua";
|
||||
|
||||
settings = {
|
||||
# Startup commands (using on hook for Lua config)
|
||||
# Startup commands — hl.on() for Lua config
|
||||
on = {
|
||||
_args = [
|
||||
"hyprland.start"
|
||||
@@ -55,8 +54,7 @@ with lib; {
|
||||
];
|
||||
};
|
||||
|
||||
# Monitor configuration — use Lua table syntax hl.monitor({...})
|
||||
# Each list entry generates one hl.monitor(...) call.
|
||||
# Monitor configuration: each list entry → hl.monitor({...})
|
||||
monitor = [
|
||||
{
|
||||
_args = [
|
||||
@@ -80,87 +78,66 @@ with lib; {
|
||||
}
|
||||
];
|
||||
|
||||
# Simple workspace→monitor bindings (legacy string format OK for hl.workspace)
|
||||
workspace = [
|
||||
"1, monitor:eDP-1, default:true"
|
||||
"2, monitor:eDP-1"
|
||||
"3, monitor:eDP-1"
|
||||
"4, monitor:HDMI-A-1"
|
||||
"6, monitor:HDMI-A-1"
|
||||
];
|
||||
|
||||
# Workspace rules with special properties → use workspace_rule + Lua table
|
||||
# Workspace rules → hl.workspace_rule({ workspace, monitor, default, ... })
|
||||
workspace_rule = [
|
||||
{
|
||||
_args = [
|
||||
{
|
||||
workspace = "5";
|
||||
monitor = "HDMI-A-1";
|
||||
no_border = true;
|
||||
no_rounding = true;
|
||||
}
|
||||
];
|
||||
workspace = "1";
|
||||
monitor = "eDP-1";
|
||||
default = true;
|
||||
}
|
||||
{
|
||||
workspace = "2";
|
||||
monitor = "eDP-1";
|
||||
}
|
||||
{
|
||||
workspace = "3";
|
||||
monitor = "eDP-1";
|
||||
}
|
||||
{
|
||||
workspace = "4";
|
||||
monitor = "HDMI-A-1";
|
||||
}
|
||||
{
|
||||
workspace = "5";
|
||||
monitor = "HDMI-A-1";
|
||||
no_border = true;
|
||||
no_rounding = true;
|
||||
}
|
||||
{
|
||||
workspace = "6";
|
||||
monitor = "HDMI-A-1";
|
||||
}
|
||||
];
|
||||
|
||||
# Window rules — match + effect fields as Lua table
|
||||
# Per Hyprland Lua docs: match fields (class, title, etc.) and
|
||||
# effect fields (workspace, fullscreen, opacity, etc.) together
|
||||
# in one table passed to hl.window_rule({...}).
|
||||
# Window rules → hl.window_rule({ match = { class = "..." }, effect, ... })
|
||||
window_rule = [
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'')
|
||||
{workspace = "1";}
|
||||
];
|
||||
match.class = "dev.zed.Zed";
|
||||
workspace = "1";
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'')
|
||||
{workspace = "1";}
|
||||
];
|
||||
match.class = "Msty";
|
||||
workspace = "1";
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'')
|
||||
{workspace = "2";}
|
||||
];
|
||||
match.class = "com\\.obsproject\\.Studio";
|
||||
workspace = "2";
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "brave-browser" })'')
|
||||
{
|
||||
workspace = "4";
|
||||
opacity = "1.0";
|
||||
}
|
||||
];
|
||||
match.class = "brave-browser";
|
||||
workspace = "4";
|
||||
opacity = "1.0";
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "vivaldi-stable" })'')
|
||||
{
|
||||
workspace = "4";
|
||||
opacity = "1.0";
|
||||
}
|
||||
];
|
||||
match.class = "vivaldi-stable";
|
||||
workspace = "4";
|
||||
opacity = "1.0";
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
|
||||
{fullscreen = true;}
|
||||
];
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
|
||||
{workspace = "5";}
|
||||
];
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
|
||||
{idle_inhibit = "focus";}
|
||||
];
|
||||
match.class = "steam_app_\\d+";
|
||||
fullscreen = true;
|
||||
workspace = "5";
|
||||
idle_inhibit = "focus";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user