nixos-configs/lib/hypr/default.nix
matt1432 85348d1a6c
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: use helper funcs for hyprland conf
2024-11-20 20:12:24 -05:00

57 lines
961 B
Nix

{
concatStringsSep,
elemAt,
optionals,
...
}: rec {
pointToStr = p: "${toString (elemAt p 0)}, ${toString (elemAt p 1)}";
mkBezier = {
name,
p0,
p1,
}:
concatStringsSep "," [name (pointToStr p0) (pointToStr p1)];
mkAnimation = {
name,
enable ? true,
duration ? 0, # in ds (100ms)
bezier ? "default",
style ? null,
}:
concatStringsSep "," (
[
name
(
if enable
then "1"
else "0"
)
]
++ optionals enable (
[
(toString duration)
bezier
]
++ optionals (style != null) [style]
)
);
mkLayerRule = {
rule,
namespace,
}:
concatStringsSep "," [rule namespace];
mkBind = {
modifier ? "",
key,
dispatcher ? "exec",
command ? null,
}:
concatStringsSep "," (
[modifier key dispatcher]
++ optionals (command != null) [command]
);
}