Home

dotnix @83a3f458a7fc525d67e79b744a5caf9c51cdb76e - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
dotnix / apps / gui / niri.nix
- raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ pkgs, ... }:
{
  home.packages = with pkgs; [
    wofi
    waybar
  ];
  programs.niri = {
    enable = true;
    settings = {
      input = {
        #keyboard = {
        #  layout = "us";
        #};
        touchpad = {
          tap = true;
          natural-scroll = true;
        };
      };

      binds = {
        "Mod+T" = {
          action.spawn = "ghostty";
        };

        # App launcher
        "Mod+D" = {
          action.spawn = [
            "wofi"
            "--show"
            "drun"
          ];
        };

        "Mod+Q" = {
          action.close-window = { };
        };

        "Mod+Shift+E" = {
          action.quit = { };
        };

        "Print" = {
          action.spawn = "grim";
        };
        "Shift+Print" = {
          action.spawn = [
            "sh"
            "-c"
            "grim -g \"$(slurp)\""
          ];
        };

        "Mod+Left" = {
          action.focus-column-left = { };
        };
        "Mod+Right" = {
          action.focus-column-right = { };
        };
        "Mod+Up" = {
          action.focus-window-up = { };
        };
        "Mod+Down" = {
          action.focus-window-down = { };
        };

        "Mod+Shift+Left" = {
          action.move-column-left = { };
        };
        "Mod+Shift+Right" = {
          action.move-column-right = { };
        };
        "Mod+Shift+Up" = {
          action.move-window-up = { };
        };
        "Mod+Shift+Down" = {
          action.move-window-down = { };
        };

        "Mod+R" = {
          action.switch-preset-column-width = { };
        };

        "Mod+1" = {
          action.focus-workspace = 1;
        };
        "Mod+2" = {
          action.focus-workspace = 2;
        };
        "Mod+3" = {
          action.focus-workspace = 3;
        };
        "Mod+4" = {
          action.focus-workspace = 4;
        };

        "Mod+Shift+1" = {
          action.move-column-to-workspace = 1;
        };
        "Mod+Shift+2" = {
          action.move-column-to-workspace = 2;
        };
        "Mod+Shift+3" = {
          action.move-column-to-workspace = 3;
        };
        "Mod+Shift+4" = {
          action.move-column-to-workspace = 4;
        };
      };

      layout = {
        gaps = 16;
        center-focused-column = "never";
      };

      window-rules = [
        {
          matches = [ { app-id = "firefox"; } ];
          default-column-width = {
            proportion = 0.5;
          };
        }
      ];
    };
  };
}