dotfiles

My PC Dotfiles & Website

modules/desktop/niri/_settings/main.nix (2161B)


 1## Compositor Settings
 2_: {
 3  config,
 4  lib,
 5  ...
 6}: let
 7  inherit (config.lib.stylix.colors) base04 base08;
 8in {
 9  programs.niri.settings = {
10    screenshot-path = "~/Pictures/Screenshots/%Y-%m-%d-%H%M%S.png";
11    environment.DISPLAY = ":0"; # XWayland Support
12    hotkey-overlay = {
13      skip-at-startup = true;
14      hide-not-bound = true;
15    };
16
17    # Use 'nwg-displays' to configure monitors
18    includes = with config.lib.niri.include; [
19      (optional "~/.config/niri/monitors.kdl")
20      (optional "~/.config/niri/workspaces.kdl")
21    ];
22
23    input = {
24      keyboard.numlock = true;
25      mouse.accel-profile = "flat";
26      warp-mouse-to-focus.enable = true;
27      workspace-auto-back-and-forth = true;
28      focus-follows-mouse = {
29        enable = true;
30        max-scroll-amount = "90%";
31      };
32      touchpad = {
33        tap = true;
34        natural-scroll = true;
35        dwt = false;
36      };
37    };
38
39    layout = {
40      tab-indicator = {
41        enable = true;
42        place-within-column = true;
43      };
44
45      default-column-width.proportion = 0.5;
46      preset-column-widths = [
47        {proportion = 1.0 / 3.0;}
48        {proportion = 0.5;}
49        {proportion = 2.0 / 3.0;}
50        {proportion = 0.85;}
51      ];
52      preset-window-heights = [
53        {proportion = 1.0 / 3.0;}
54        {proportion = 0.5;}
55        {proportion = 2.0 / 3.0;}
56        {proportion = 1.0;}
57      ];
58    };
59
60    # Mouse Gestures
61    gestures.hot-corners.enable = true;
62
63    # Window Switcher
64    recent-windows = {
65      enable = true;
66      open-delay-ms = 150;
67      highlight = {
68        active-color = "#${base04}";
69        urgent-color = "#${base08}";
70        padding = 30;
71        corner-radius = 7;
72      };
73      previews = {
74        max-height = 480;
75        max-scale = 0.5;
76      };
77      binds = let
78        ra = lib.mergeAttrsList config.lib.niri.actions.recent-windows;
79      in {
80        "Alt+Tab".action = ra.next-window;
81        "Alt+Shift+Tab".action = ra.previous-window;
82        "Alt+grave".action = ra.next-window {filter = "app-id";};
83        "Alt+Shift+grave".action = ra.previous-window {filter = "app-id";};
84      };
85    };
86  };
87}