config.nix/home/desktop/window-managers/niri.nix
2026-04-11 17:21:28 +02:00

112 lines
3 KiB
Nix

{
config,
pkgs,
lib,
inputs,
osConfig,
...
}:
let
modifier = if (osConfig.keybinds.modifier == "Meta") then "Mod" else null;
kb-layout = builtins.substring 0 2 osConfig.system.locale;
in
{
config =
if osConfig.desktop.window-managers.niri.enable then
{
home.file = {
"~/.config/niri/config.kdl" = {
target = ".config/niri/config.kdl";
text = ''
input {
keyboard {
xkb {
layout "${kb-layout}"
}
repeat-delay 600
repeat-rate 20
track-layout "global"
}
touchpad {
tap
dwt
accel-profile "flat"
accel-speed 0.0
scroll-method "two-finger"
}
mouse {
accel-speed 0.5
accel-profile "flat"
}
}
gestures {
hot-corners {
off
}
}
cursor {
hide-when-typing
hide-after-inactive-ms 2000
}
xwayland-satellite {
path "xwayland-satellite"
}
hotkey-overlay {
hide-not-bound
}
binds {
${modifier}+Down cooldown-ms=150 { focus-workspace-down; }
${modifier}+Up cooldown-ms=150 { focus-workspace-up; }
${modifier}+${osConfig.keybinds.hotkeys.terminal} { spawn "${osConfig.apps.terminal.binary}";}
${modifier}+Left {focus-column-left; }
${modifier}+Right {focus-column-right; }
${modifier}+${osConfig.keybinds.hotkeys.browser} { spawn "${osConfig.apps.internet.browsers.default}";}
${modifier}+${osConfig.keybinds.hotkeys.launcher} { spawn "${osConfig.desktop.shell.launcher}";}
Print { screenshot;}
${modifier}+Shift+${osConfig.keybinds.hotkeys.close-window} { close-window; }
${modifier}+Shift+${osConfig.keybinds.hotkeys.editor} { spawn "${osConfig.apps.development.editor.default}";}
}
spawn-at-startup "elephant"
spawn-at-startup "noctalia-shell"
spawn-at-startup "walker --gapplication-service"
layout {
gaps 20
focus-ring {
width 5
}
border {
off
}
}
window-rule {
geometry-corner-radius 20
clip-to-geometry true
}
prefer-no-csd
include "noctalia.kdl"
'';
};
};
}
else
{ };
}