nixconf/home-manager/niri.nix
Gabriella Bere a48763c70d set monitor refresh rate to 120Hz
cant set it to 144 because either the dGPU in this laptop or the MST hub
its connected through doesn't have the bandwidth, and i get weird
artifacting, just like i did on hyprland.

it was at 60Hz before btw, so this should make animations look nicer

in doing this niri decided it needed to rewrite the mimeapps file, so i
added the imperative entries that had appeared in there to home.nix and
now its all done properly :3
2025-11-07 18:48:06 +00:00

169 lines
5.2 KiB
Nix

{ pkgs, config, lib, niri, ... }: {
nixpkgs.overlays = [ niri.overlays.niri ];
programs.niri = {
enable = true;
package = pkgs.niri-unstable; # provided by the flake
settings = {
prefer-no-csd = true; # no client-side-decorations
hotkey-overlay = {
skip-at-startup = true;
};
input = {
mod-key = "SUPER";
focus-follows-mouse = {
enable = true;
max-scroll-amount = "0%";
};
warp-mouse-to-focus.enable = true;
mouse.natural-scroll = false;
touchpad = {
natural-scroll = false;
dwt = true; # disable when typing
};
};
spawn-at-startup = [
{ argv = ["kitty"]; }
{ argv = ["owncloud"]; }
];
outputs = {
"eDP-2" = {
focus-at-startup = true;
#name = "laptop_monitor";
position = {
x = 0;
y = 0;
};
};
"Lenovo Group Limited LEN G24-10 U5B4ZAM2" = {
#name = "right_monitor";
position = {
x = 960;
y = -1080;
};
mode = {
width = 1920;
height = 1080;
refresh = 119.982;
};
};
"Lenovo Group Limited LEN G24-10 U5B4KL78" = {
#name = "left_monitor";
position = {
x = -960;
y = -1080;
};
mode = {
width = 1920;
height = 1080;
refresh = 119.982;
};
};
};
workspaces = {
"main" = {
open-on-output = "eDP-2";
name = "Main";
};
"comms" = {
open-on-output = "Lenovo Group Limited LEN G24-10 U5B4KL78";
name = "Communication";
};
"bg_noise" = {
open-on-output = "Lenovo Group Limited LEN G24-10 U5B4ZAM2";
name = "Media";
};
};
layout = {
gaps = 5;
struts =
let
l = 5;
in
{
left = l;
right = l;
bottom = l;
top = l;
};
preset-column-widths = [
{ proportion = 1. / 2.; }
{ proportion = 1. / 1.; }
];
};
binds =
(with config.lib.niri.actions; {
# keybinds for spawning apps
"Mod+1".action = spawn "kitty";
"Mod+F".action = spawn "librewolf";
"Mod+D".action = spawn "vesktop";
"Mod+Space".action = spawn "fuzzel";
"Mod+Alt+L".action = spawn "hyprlock";
"Print".action = spawn "sh -c niri msg action screenshot";
"Mod+2".action = show-hotkey-overlay;
# window controls
#"Super".action = toggle-overview; # this doesnt work without release binds, the PR for which is my first bookmark in ~/bookmarks.html
"Mod+F11".action = fullscreen-window;
"Mod+x".action = close-window;
"Mod+Tab".action = toggle-window-floating;
"Mod+h".action = focus-column-or-monitor-left;
"Mod+j".action = focus-window-or-monitor-down;
"Mod+k".action = focus-window-or-monitor-up;
"Mod+l".action = focus-column-or-monitor-right;
"Mod+Shift+h".action = move-column-left-or-to-monitor-left;
"Mod+Shift+j".action = move-window-down;
"Mod+Shift+k".action = move-window-up;
"Mod+Shift+l".action = move-column-right-or-to-monitor-right;
"Mod+Ctrl+j".action = focus-workspace-down;
"Mod+Ctrl+k".action = focus-workspace-up;
"Mod+Ctrl+Shift+j".action = move-window-to-workspace-down;
"Mod+Ctrl+Shift+k".action = move-window-to-workspace-up;
"Mod+Comma".action = consume-or-expel-window-left;
"Mod+Period".action = consume-or-expel-window-right;
"Mod+Return".action = switch-preset-column-width;
"Mod+WheelScrollUp".action = focus-workspace-up;
"Mod+WheelScrollDown".action = focus-workspace-down;
"Mod+Up".action = focus-workspace-up;
"Mod+Down".action = focus-workspace-down;
# not sure how to do the "send window to workspace" keybinds from the hyprland config
"XF86AudioPause".action = spawn "playerctl play-pause";
})
// # this operator merges attrsets together, allowing me to use the nice syntax for most of the config, but the less nice syntax for the one option that broke in the nice-syntax-generator in the niri flake
({
"Print".action.screenshot.show-pointer = false;
});
window-rules = [
{
geometry-corner-radius =
let
r = 10.0;
in
{
top-left = r;
top-right = r;
bottom-left = r;
bottom-right = r;
};
clip-to-geometry = true;
}
{
excludes = [
{
is-active = true;
}
];
opacity = 0.8;
draw-border-with-background = false;
}
];
xwayland-satellite = {
enable = true;
path = lib.getExe pkgs.xwayland-satellite;
};
};
};
}