tangled
alpha
login
or
join now
matthew-hre.com
/
flake
0
fork
atom
My NixOS configuration (mirror)
0
fork
atom
overview
issues
pulls
pipelines
feat: broke niri config into further files
matthew-hre.com
6 months ago
cddfe56f
cbb5f5b6
+159
-154
3 changed files
expand all
collapse all
unified
split
home
wayland
niri
binds.nix
default.nix
rules.nix
+77
home/wayland/niri/binds.nix
···
1
1
+
{config, ...}: {
2
2
+
programs.niri.settings.binds = with config.lib.niri.actions; let
3
3
+
sh = spawn "sh" "-c";
4
4
+
in {
5
5
+
"Mod+Space".action.spawn = ["fuzzel"];
6
6
+
"Mod+Return".action.spawn = ["ghostty" "+new-window"];
7
7
+
"Mod+Q".action = close-window;
8
8
+
"Mod+F".action = maximize-column;
9
9
+
"Mod+Shift+F".action = fullscreen-window;
10
10
+
"Mod+G".action = toggle-window-floating;
11
11
+
"Mod+C".action = center-column;
12
12
+
"Mod+V".action = sh "cliphist list | fuzzel --dmenu | cliphist decode | wl-copy";
13
13
+
14
14
+
"Mod+L".action.spawn = ["hyprlock"];
15
15
+
16
16
+
"Mod+Minus".action = set-column-width "-10%";
17
17
+
"Mod+Equal".action = set-column-width "+10%";
18
18
+
19
19
+
"Mod+Shift+Minus".action = set-window-height "-10%";
20
20
+
"Mod+Shift+Equal".action = set-window-height "+10%";
21
21
+
22
22
+
"Mod+Left".action = focus-column-left;
23
23
+
"Mod+Down".action = focus-workspace-down;
24
24
+
"Mod+Up".action = focus-workspace-up;
25
25
+
"Mod+Right".action = focus-column-right;
26
26
+
27
27
+
"Mod+Shift+Left".action = move-column-left;
28
28
+
"Mod+Shift+Down".action = move-window-down;
29
29
+
"Mod+Shift+Up".action = move-window-up;
30
30
+
"Mod+Shift+Right".action = move-column-right;
31
31
+
32
32
+
"Mod+Shift+Ctrl+Left".action = consume-or-expel-window-left;
33
33
+
"Mod+Shift+Ctrl+Right".action = consume-or-expel-window-right;
34
34
+
35
35
+
"Mod+Shift+S".action = screenshot;
36
36
+
"Print".action = screenshot;
37
37
+
"Alt+Print".action = screenshot-window;
38
38
+
39
39
+
"Mod+Shift+Slash".action = show-hotkey-overlay;
40
40
+
41
41
+
"Ctrl+Alt+Delete".action.spawn = ["~/nix-config/scripts/fuzzel_power.sh"];
42
42
+
43
43
+
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" "--limit" "1.0"];
44
44
+
"XF86AudioRaiseVolume".allow-when-locked = true;
45
45
+
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"];
46
46
+
"XF86AudioLowerVolume".allow-when-locked = true;
47
47
+
"XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
48
48
+
"XF86AudioMute".allow-when-locked = true;
49
49
+
"XF86AudioMicMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"];
50
50
+
"XF86AudioMicMute".allow-when-locked = true;
51
51
+
"XF86MonBrightnessDown".action.spawn = ["brightnessctl" "set" "5%-"];
52
52
+
"XF86MonBrightnessUp".action.spawn = ["brightnessctl" "set" "5%+"];
53
53
+
54
54
+
"Mod+1".action = focus-workspace 1;
55
55
+
"Mod+2".action = focus-workspace 2;
56
56
+
"Mod+3".action = focus-workspace 3;
57
57
+
"Mod+4".action = focus-workspace 4;
58
58
+
"Mod+5".action = focus-workspace 5;
59
59
+
"Mod+6".action = focus-workspace 6;
60
60
+
"Mod+7".action = focus-workspace 7;
61
61
+
"Mod+8".action = focus-workspace 8;
62
62
+
"Mod+9".action = focus-workspace 9;
63
63
+
64
64
+
# waiting for sodiboo/niri-flake#1018 to be fixed
65
65
+
"Mod+Shift+1".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "1"];
66
66
+
"Mod+Shift+2".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "2"];
67
67
+
"Mod+Shift+3".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "3"];
68
68
+
"Mod+Shift+4".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "4"];
69
69
+
"Mod+Shift+5".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "5"];
70
70
+
"Mod+Shift+6".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "6"];
71
71
+
"Mod+Shift+7".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "7"];
72
72
+
"Mod+Shift+8".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "8"];
73
73
+
"Mod+Shift+9".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "9"];
74
74
+
75
75
+
"Mod+Z".action = toggle-overview;
76
76
+
};
77
77
+
}
+6
-154
home/wayland/niri/default.nix
···
1
1
-
{
2
2
-
config,
3
3
-
pkgs,
4
4
-
...
5
5
-
}: let
1
1
+
{pkgs, ...}: let
6
2
makeCommand = command: {
7
3
command = [command];
8
4
};
9
5
in {
6
6
+
imports = [
7
7
+
./binds.nix
8
8
+
./rules.nix
9
9
+
];
10
10
+
10
11
programs.niri = {
11
12
enable = true;
12
13
package = pkgs.niri;
···
43
44
44
45
gestures.hot-corners.enable = false;
45
46
46
46
-
binds = with config.lib.niri.actions; let
47
47
-
sh = spawn "sh" "-c";
48
48
-
in {
49
49
-
"Mod+Space".action.spawn = ["fuzzel"];
50
50
-
"Mod+Return".action.spawn = ["ghostty" "+new-window"];
51
51
-
"Mod+Q".action = close-window;
52
52
-
"Mod+F".action = maximize-column;
53
53
-
"Mod+Shift+F".action = fullscreen-window;
54
54
-
"Mod+G".action = toggle-window-floating;
55
55
-
"Mod+C".action = center-column;
56
56
-
"Mod+V".action = sh "cliphist list | fuzzel --dmenu | cliphist decode | wl-copy";
57
57
-
58
58
-
"Mod+L".action.spawn = ["hyprlock"];
59
59
-
60
60
-
"Mod+Minus".action = set-column-width "-10%";
61
61
-
"Mod+Equal".action = set-column-width "+10%";
62
62
-
63
63
-
"Mod+Shift+Minus".action = set-window-height "-10%";
64
64
-
"Mod+Shift+Equal".action = set-window-height "+10%";
65
65
-
66
66
-
"Mod+Left".action = focus-column-left;
67
67
-
"Mod+Down".action = focus-workspace-down;
68
68
-
"Mod+Up".action = focus-workspace-up;
69
69
-
"Mod+Right".action = focus-column-right;
70
70
-
71
71
-
"Mod+Shift+Left".action = move-column-left;
72
72
-
"Mod+Shift+Down".action = move-window-down;
73
73
-
"Mod+Shift+Up".action = move-window-up;
74
74
-
"Mod+Shift+Right".action = move-column-right;
75
75
-
76
76
-
"Mod+Shift+Ctrl+Left".action = consume-or-expel-window-left;
77
77
-
"Mod+Shift+Ctrl+Right".action = consume-or-expel-window-right;
78
78
-
79
79
-
"Mod+Shift+S".action = screenshot;
80
80
-
"Print".action = screenshot;
81
81
-
"Alt+Print".action = screenshot-window;
82
82
-
83
83
-
"Mod+Shift+Slash".action = show-hotkey-overlay;
84
84
-
85
85
-
"Ctrl+Alt+Delete".action.spawn = ["~/nix-config/scripts/fuzzel_power.sh"];
86
86
-
87
87
-
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" "--limit" "1.0"];
88
88
-
"XF86AudioRaiseVolume".allow-when-locked = true;
89
89
-
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"];
90
90
-
"XF86AudioLowerVolume".allow-when-locked = true;
91
91
-
"XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
92
92
-
"XF86AudioMute".allow-when-locked = true;
93
93
-
"XF86AudioMicMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"];
94
94
-
"XF86AudioMicMute".allow-when-locked = true;
95
95
-
"XF86MonBrightnessDown".action.spawn = ["brightnessctl" "set" "5%-"];
96
96
-
"XF86MonBrightnessUp".action.spawn = ["brightnessctl" "set" "5%+"];
97
97
-
98
98
-
"Mod+1".action = focus-workspace 1;
99
99
-
"Mod+2".action = focus-workspace 2;
100
100
-
"Mod+3".action = focus-workspace 3;
101
101
-
"Mod+4".action = focus-workspace 4;
102
102
-
"Mod+5".action = focus-workspace 5;
103
103
-
"Mod+6".action = focus-workspace 6;
104
104
-
"Mod+7".action = focus-workspace 7;
105
105
-
"Mod+8".action = focus-workspace 8;
106
106
-
"Mod+9".action = focus-workspace 9;
107
107
-
108
108
-
# waiting for sodiboo/niri-flake#1018 to be fixed
109
109
-
"Mod+Shift+1".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "1"];
110
110
-
"Mod+Shift+2".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "2"];
111
111
-
"Mod+Shift+3".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "3"];
112
112
-
"Mod+Shift+4".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "4"];
113
113
-
"Mod+Shift+5".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "5"];
114
114
-
"Mod+Shift+6".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "6"];
115
115
-
"Mod+Shift+7".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "7"];
116
116
-
"Mod+Shift+8".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "8"];
117
117
-
"Mod+Shift+9".action.spawn = ["niri" "msg" "action" "move-column-to-workspace" "9"];
118
118
-
119
119
-
"Mod+Z".action = toggle-overview;
120
120
-
};
121
121
-
122
47
switch-events = {
123
48
lid-close.action.spawn = ["hyprlock"];
124
49
};
···
189
114
return color;
190
115
}
191
116
'';
192
192
-
193
193
-
window-rules = [
194
194
-
(let
195
195
-
allCorners = r: {
196
196
-
bottom-left = r;
197
197
-
bottom-right = r;
198
198
-
top-left = r;
199
199
-
top-right = r;
200
200
-
};
201
201
-
in {
202
202
-
geometry-corner-radius = allCorners 10.0;
203
203
-
clip-to-geometry = true;
204
204
-
draw-border-with-background = false;
205
205
-
})
206
206
-
207
207
-
{
208
208
-
matches = [
209
209
-
{
210
210
-
app-id = "steam";
211
211
-
}
212
212
-
{
213
213
-
title = "^notificationtoasts_\d+_desktop$";
214
214
-
}
215
215
-
];
216
216
-
default-floating-position = {
217
217
-
x = 10;
218
218
-
y = 10;
219
219
-
relative-to = "bottom-right";
220
220
-
};
221
221
-
}
222
222
-
{
223
223
-
matches = [
224
224
-
{
225
225
-
app-id = "com.network.manager";
226
226
-
}
227
227
-
{
228
228
-
title = "^Network Manager$";
229
229
-
}
230
230
-
];
231
231
-
open-floating = true;
232
232
-
default-window-height.fixed = 400;
233
233
-
default-column-width.proportion = 0.25;
234
234
-
default-floating-position = {
235
235
-
x = 10;
236
236
-
y = 10;
237
237
-
relative-to = "top-right";
238
238
-
};
239
239
-
}
240
240
-
{
241
241
-
matches = [
242
242
-
{is-floating = true;}
243
243
-
];
244
244
-
shadow.enable = true;
245
245
-
}
246
246
-
{
247
247
-
matches = [
248
248
-
{
249
249
-
app-id = "1Password";
250
250
-
}
251
251
-
];
252
252
-
block-out-from = "screencast";
253
253
-
}
254
254
-
];
255
255
-
layer-rules = [
256
256
-
{
257
257
-
matches = [
258
258
-
{
259
259
-
namespace = "^swww-daemon$";
260
260
-
}
261
261
-
];
262
262
-
place-within-backdrop = true;
263
263
-
}
264
264
-
];
265
117
};
266
118
};
267
119
}
+76
home/wayland/niri/rules.nix
···
1
1
+
{
2
2
+
programs.niri.settings = {
3
3
+
window-rules = [
4
4
+
(let
5
5
+
allCorners = r: {
6
6
+
bottom-left = r;
7
7
+
bottom-right = r;
8
8
+
top-left = r;
9
9
+
top-right = r;
10
10
+
};
11
11
+
in {
12
12
+
geometry-corner-radius = allCorners 10.0;
13
13
+
clip-to-geometry = true;
14
14
+
draw-border-with-background = false;
15
15
+
})
16
16
+
17
17
+
{
18
18
+
matches = [
19
19
+
{
20
20
+
app-id = "steam";
21
21
+
}
22
22
+
{
23
23
+
title = "^notificationtoasts_\d+_desktop$";
24
24
+
}
25
25
+
];
26
26
+
default-floating-position = {
27
27
+
x = 10;
28
28
+
y = 10;
29
29
+
relative-to = "bottom-right";
30
30
+
};
31
31
+
}
32
32
+
{
33
33
+
matches = [
34
34
+
{
35
35
+
app-id = "com.network.manager";
36
36
+
}
37
37
+
{
38
38
+
title = "^Network Manager$";
39
39
+
}
40
40
+
];
41
41
+
open-floating = true;
42
42
+
default-window-height.fixed = 400;
43
43
+
default-column-width.proportion = 0.25;
44
44
+
default-floating-position = {
45
45
+
x = 10;
46
46
+
y = 10;
47
47
+
relative-to = "top-right";
48
48
+
};
49
49
+
}
50
50
+
{
51
51
+
matches = [
52
52
+
{is-floating = true;}
53
53
+
];
54
54
+
shadow.enable = true;
55
55
+
}
56
56
+
{
57
57
+
matches = [
58
58
+
{
59
59
+
app-id = "1Password";
60
60
+
}
61
61
+
];
62
62
+
block-out-from = "screencast";
63
63
+
}
64
64
+
];
65
65
+
layer-rules = [
66
66
+
{
67
67
+
matches = [
68
68
+
{
69
69
+
namespace = "^swww-daemon$";
70
70
+
}
71
71
+
];
72
72
+
place-within-backdrop = true;
73
73
+
}
74
74
+
];
75
75
+
};
76
76
+
}