some more updates

This commit is contained in:
KoenDR06 2025-07-18 13:53:28 +02:00
parent 270e52070d
commit d5ce93f871
2 changed files with 77 additions and 66 deletions

View file

@ -44,6 +44,7 @@
wallpaper = ../../misc/portrait.png; wallpaper = ../../misc/portrait.png;
} }
]; ];
bindWorkspaces = "interlaced";
}; };
}; };
}; };

View file

@ -3,8 +3,8 @@
config, config,
... ...
}: let }: let
inherit (lib) mkOption mkIf types trivial strings replaceStrings; inherit (lib) mkOption mkIf types trivial strings;
inherit (builtins) concatStringsSep elem; inherit (builtins) concatStringsSep elem genList elemAt;
cfg = config.horseman.wm.hyprland; cfg = config.horseman.wm.hyprland;
homeCfg = config.horseman; homeCfg = config.horseman;
keybinding = types.submodule { keybinding = types.submodule {
@ -158,6 +158,10 @@ in {
monitors = { monitors = {
defaultMonitor = mkOption {type = types.bool;}; defaultMonitor = mkOption {type = types.bool;};
bindWorkspaces = mkOption {
type = types.enum ["no" "interlaced"];
default = "no";
};
displays = mkOption { displays = mkOption {
type = types.listOf (types.submodule { type = types.listOf (types.submodule {
@ -225,8 +229,6 @@ in {
}); });
}; };
}; };
}; };
}; };
@ -269,7 +271,7 @@ in {
${concatStringsSep "\n" (map (kb: "bind${concatStringsSep "" kb.flags} = ${concatStringsSep " " kb.mods}, ${kb.key}, ${kb.dispatcher}${ ${concatStringsSep "\n" (map (kb: "bind${concatStringsSep "" kb.flags} = ${concatStringsSep " " kb.mods}, ${kb.key}, ${kb.dispatcher}${
if (elem "m" kb.flags) # Mouse binds take one argument less if (elem "m" kb.flags) # Mouse binds take one argument less
then "" then ""
else ", ${replaceStrings ["%"] ["%%"] kb.params}" else ", ${kb.params}"
}") }")
cfg.config.keybindings.binds)} cfg.config.keybindings.binds)}
@ -280,7 +282,7 @@ in {
${concatStringsSep "\n" (map (kb: "bind${concatStringsSep "" kb.flags} = ${concatStringsSep " " kb.mods}, ${kb.key}, ${kb.dispatcher}${ ${concatStringsSep "\n" (map (kb: "bind${concatStringsSep "" kb.flags} = ${concatStringsSep " " kb.mods}, ${kb.key}, ${kb.dispatcher}${
if (elem "m" kb.flags) # Mouse binds take one argument less if (elem "m" kb.flags) # Mouse binds take one argument less
then "" then ""
else ", ${replaceStrings ["%"] ["%%"] kb.params}" else ", ${kb.params}"
}") }")
sm.binds)} sm.binds)}
@ -330,7 +332,7 @@ in {
${concatStringsSep "\n " (map (bez: "bezier = ${bez.name}, ${strings.floatToString bez.startX}, ${strings.floatToString bez.startY}, ${strings.floatToString bez.endX}, ${strings.floatToString bez.endY}") cfg.config.animations.beziers)} ${concatStringsSep "\n " (map (bez: "bezier = ${bez.name}, ${strings.floatToString bez.startX}, ${strings.floatToString bez.startY}, ${strings.floatToString bez.endX}, ${strings.floatToString bez.endY}") cfg.config.animations.beziers)}
${concatStringsSep "\n " (map (anim: "animation = ${anim.name}, ${toString anim.on}, ${strings.floatToString anim.speed}, ${anim.curve}, ${replaceStrings ["%"] ["%%"] anim.style}") cfg.config.animations.animations)} ${concatStringsSep "\n " (map (anim: "animation = ${anim.name}, ${toString anim.on}, ${strings.floatToString anim.speed}, ${anim.curve}, ${anim.style}") cfg.config.animations.animations)}
} }
dwindle { dwindle {
@ -372,11 +374,18 @@ in {
else "" else ""
} }
${concatStringsSep "\n" (map (wr: "windowrule = " + wr) cfg.config.windowrules)}
${concatStringsSep "\n" (map (ws: "workspace = " + ws) cfg.config.workspaces)} ${concatStringsSep "\n" (map (ws: "workspace = " + ws) cfg.config.workspaces)}
${concatStringsSep "\n" (map (wr: "windowrule = " + replaceStrings ["%"] ["%%"] wr) cfg.config.windowrules)} ${
concatStringsSep "\n" (
if cfg.config.monitors.bindWorkspaces == "interlaced"
then (map (x: "workspace = ${toString (x + 1)}, persistent:true, monitor:${(elemAt cfg.config.monitors.displays (x - (2 * (x / 2)))).output}") (genList (x: x) 10))
else []
)
}
''; '';
};
xdg.configFile."hypr/hyprlock.conf".text = '' xdg.configFile."hypr/hyprlock.conf".text = ''
$font = Monospace $font = Monospace
@ -436,4 +445,5 @@ in {
} }
''; '';
}; };
};
} }