feat: fixed(?) binds and window-rules modules
This commit is contained in:
parent
e540b21ed9
commit
e7320119cd
2 changed files with 104 additions and 103 deletions
|
|
@ -1,55 +1,8 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
widthDivisions = [
|
||||
1.0
|
||||
2.0
|
||||
3.0
|
||||
4.0
|
||||
];
|
||||
heightDivisions = [
|
||||
1.0
|
||||
2.0
|
||||
3.0
|
||||
4.0
|
||||
];
|
||||
|
||||
# black magic, expected output:
|
||||
# [ { proportion = 1.0 / 1.0 }
|
||||
# { proportion = 1.0 / 2.0 }
|
||||
# ...
|
||||
# { proportion = 2.0 / 1.0 }
|
||||
# { proportion = 2.0 / 3.0 }
|
||||
# ...
|
||||
# { proportion = 4.0 / 4.0 } ]
|
||||
getProportions =
|
||||
divisions:
|
||||
lib.lists.unique (
|
||||
lib.lists.flatten (
|
||||
# TODO: make this a callable function
|
||||
map (x: map (y: { proportion = x / y; }) divisions) divisions
|
||||
)
|
||||
);
|
||||
|
||||
# then get all the unique outputs (removing double ups of 0.5 or others)
|
||||
# just getting all the values below 1
|
||||
columnWidths = getProportions widthDivisions;
|
||||
columnWidthsFiltered = builtins.filter (x: builtins.lessThan x.proportion 1.0) columnWidths;
|
||||
windowHeights = getProportions heightDivisions;
|
||||
windowHeightsFiltered = builtins.filter (x: builtins.lessThan x.proportion 1.0) windowHeights;
|
||||
|
||||
in
|
||||
{ self, inputs, ... }:
|
||||
|
||||
{
|
||||
|
||||
# niri keybinds module declaration
|
||||
flake.nixosModules.niri-binds =
|
||||
{
|
||||
config,
|
||||
|
|
@ -57,6 +10,48 @@ in
|
|||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
widthDivisions = [
|
||||
1.0
|
||||
2.0
|
||||
3.0
|
||||
4.0
|
||||
];
|
||||
heightDivisions = [
|
||||
1.0
|
||||
2.0
|
||||
3.0
|
||||
4.0
|
||||
];
|
||||
|
||||
# black magic, expected output:
|
||||
# [ { proportion = 1.0 / 1.0 }
|
||||
# { proportion = 1.0 / 2.0 }
|
||||
# ...
|
||||
# { proportion = 2.0 / 1.0 }
|
||||
# { proportion = 2.0 / 3.0 }
|
||||
# ...
|
||||
# { proportion = 4.0 / 4.0 } ]
|
||||
getProportions =
|
||||
divisions:
|
||||
lib.lists.unique (
|
||||
lib.lists.flatten (
|
||||
# TODO: make this a callable function
|
||||
map (x: map (y: { proportion = x / y; }) divisions) divisions
|
||||
)
|
||||
);
|
||||
|
||||
# then get all the unique outputs (removing double ups of 0.5 or others)
|
||||
# just getting all the values below 1
|
||||
columnWidths = getProportions widthDivisions;
|
||||
columnWidthsFiltered = builtins.filter (x: builtins.lessThan x.proportion 1.0) columnWidths;
|
||||
windowHeights = getProportions heightDivisions;
|
||||
windowHeightsFiltered = builtins.filter (x: builtins.lessThan x.proportion 1.0) windowHeights;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
# for home manager functionality
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue