feat: fixed(?) binds and window-rules modules
This commit is contained in:
parent
c23715f2f1
commit
e540b21ed9
2 changed files with 148 additions and 118 deletions
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
|
|
@ -6,6 +8,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
|
||||
widthDivisions = [
|
||||
1.0
|
||||
2.0
|
||||
|
|
@ -37,20 +40,34 @@ let
|
|||
);
|
||||
|
||||
# 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; # just get the values that are below 1
|
||||
|
||||
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
|
||||
|
||||
{
|
||||
|
||||
## Goals:
|
||||
## - Way to open new windows in specific areas of the creen
|
||||
## - Way to spawn terminals floating
|
||||
## - Interact with Noctalia shell more with binds
|
||||
# credit sodiboo for this one in particular
|
||||
flake.nixosModules.niri-binds =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# for home manager functionality
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
# niri personalisation
|
||||
home-manager.users.serenity = {
|
||||
|
||||
imports = [ inputs.niri.homeModules.niri ];
|
||||
|
||||
# black magic for column widths
|
||||
programs.niri.settings.layout = {
|
||||
preset-column-widths =
|
||||
builtins.sort
|
||||
|
|
@ -58,14 +75,13 @@ in
|
|||
(a: b: builtins.lessThan a.proportion b.proportion)
|
||||
columnWidthsFiltered;
|
||||
default-column-width.proportion = 1.0 / 3.0;
|
||||
|
||||
preset-window-heights = builtins.sort (
|
||||
a: b: builtins.lessThan a.proportion b.proportion
|
||||
) windowHeightsFiltered;
|
||||
};
|
||||
programs.niri.settings.binds = with config.lib.niri.actions; {
|
||||
|
||||
## Window manager controls
|
||||
# actual keybinds
|
||||
programs.niri.settings.binds = with config.lib.niri.actions; {
|
||||
|
||||
# Debug & Utility
|
||||
"Mod+Shift+Slash".action = show-hotkey-overlay; # I am forgetful
|
||||
|
|
@ -154,4 +170,6 @@ in
|
|||
#"Mod+hypothetical+bind".action.record-entire-screen = {show-pointer = true;};
|
||||
#"Mod+hypothetical+bind".action.record-all-screens = {show-pointer = true;};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
_:
|
||||
{ self, inputs, ... }:
|
||||
|
||||
let
|
||||
|
||||
windowRules = [
|
||||
{
|
||||
geometry-corner-radius =
|
||||
|
|
@ -38,7 +40,7 @@ let
|
|||
title = "btop";
|
||||
}
|
||||
];
|
||||
open-on-output = "DP-1";
|
||||
open-on-output = "DP-4";
|
||||
open-on-workspace = "System";
|
||||
open-maximized = true;
|
||||
}
|
||||
|
|
@ -48,8 +50,16 @@ let
|
|||
open-focused = true;
|
||||
}
|
||||
];
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
flake.nixosModules.niri-window-rules = { pkgs, ... }: {
|
||||
|
||||
# for home manager functionality
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
home-manager.users.serenity = {
|
||||
programs.niri.settings = {
|
||||
window-rules = windowRules;
|
||||
layout = {
|
||||
|
|
@ -62,4 +72,6 @@ in
|
|||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue