aboutsummaryrefslogtreecommitdiff
path: root/modules/desktop/hjem/wm/niri.nix
blob: c6826af45099b40bf1ded0ddc880d0a6f27b199c (plain)
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,
  config,
  lib,
  ...
}: let
  cfg = config.collinux.desktop.wm.niri;
in
  lib.mkIf cfg.enable {
    files.".config/niri/config.kdl".text = ''
      spawn-sh-at-startup "${config.collinux.desktop.wallpaper_cmd}"
      spawn-at-startup "${pkgs.playerctl}/bin/playerctld daemon"
      spawn-at-startup "dunst"

      prefer-no-csd
      environment {
        GTK_CSD "1"
      }

      output "eDP-1" {
        scale 1.0
      }

      input {
        focus-follows-mouse

        keyboard {
          xkb {
            options "caps:none"
          }
        }
      }

      hotkey-overlay {
          skip-at-startup
          hide-not-bound
      }

      binds {
        Mod+Space repeat=false { spawn "fuzzel"; }
        Mod+Return repeat=false { spawn "foot"; }
        Mod+B repeat=false { spawn "firefox"; }

        Mod+Q repeat=false { close-window; }
        Mod+S repeat=false { screenshot; }
        Mod+M repeat=false { maximize-column; }

        XF86MonBrightnessUp { spawn "~/.config/util.lua" "brightness" "5%+"; }
        XF86MonBrightnessDown { spawn "~/.config/util.lua" "brightness" "5%-"; }
        XF86AudioRaiseVolume { spawn "~/.config/util.lua" "vol" "5%+"; }
        XF86AudioLowerVolume { spawn "~/.config/util.lua" "vol" "5%-"; }
      }

      gestures {
        hot-corners {
          off
        }
      }

      overview {
        zoom 0.66
        workspace-shadow {
          off
        }
      }

      layout {
        gaps 12

        focus-ring {
          off
        }

        border {
          width 3
          active-color "#ffffff00"
          inactive-color "#ffffff00"
          urgent-color "#ffffff00"
        }

        struts {
          left 0
          right 0
          top 0
          bottom 0
        }

        background-color "transparent"
      }

      layer-rule {
          match namespace="^wallpaper$"
          place-within-backdrop true
      }

      layer-rule {
        match namespace="^launcher$"
        shadow {
          on
        }
      }

      layer-rule {
        match namespace="^notifications$"
        shadow {
          on
        }
      }

      window-rule {
        match app-id="firefox"
        open-maximized true
      }

      window-rule {
        match is-focused=true
        shadow {
          on
        }
      }

    '';

    packages = [pkgs.niri pkgs.xwayland-satellite];
  }