aboutsummaryrefslogtreecommitdiff
path: root/hosts/mantis
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/mantis')
-rw-r--r--hosts/mantis/configuration.nix4
-rw-r--r--hosts/mantis/home.nix3
-rw-r--r--hosts/mantis/niri-config.kdl470
3 files changed, 474 insertions, 3 deletions
diff --git a/hosts/mantis/configuration.nix b/hosts/mantis/configuration.nix
index d21a7b1..76bf237 100644
--- a/hosts/mantis/configuration.nix
+++ b/hosts/mantis/configuration.nix
@@ -22,7 +22,6 @@
22 prompt 22 prompt
23 better-text-objs 23 better-text-objs
24 vim-colors-plain 24 vim-colors-plain
25 niri
26 ]; 25 ];
27 26
28 nixpkgs.config = { 27 nixpkgs.config = {
@@ -41,8 +40,6 @@
41 }; 40 };
42 }; 41 };
43 42
44 programs.niri.enable = true;
45
46 users.users.op = { 43 users.users.op = {
47 isNormalUser = true; 44 isNormalUser = true;
48 extraGroups = [ "wheel" "docker" ]; 45 extraGroups = [ "wheel" "docker" ];
@@ -63,6 +60,7 @@
63 ]; 60 ];
64 variables = { 61 variables = {
65 QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor"; 62 QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor";
63 NIXOS_OZONE_WL = "1";
66 }; 64 };
67 }; 65 };
68 66
diff --git a/hosts/mantis/home.nix b/hosts/mantis/home.nix
index bcdb0ee..e196052 100644
--- a/hosts/mantis/home.nix
+++ b/hosts/mantis/home.nix
@@ -14,6 +14,9 @@
14 # ./mail.nix 14 # ./mail.nix
15 ]; 15 ];
16 16
17 programs.niri.enable = true;
18 programs.niri.config = builtins.readFile ./niri-config.kdl;
19
17 home.stateVersion = "22.11"; 20 home.stateVersion = "22.11";
18 home.username = "op"; 21 home.username = "op";
19 home.homeDirectory = "/home/op"; 22 home.homeDirectory = "/home/op";
diff --git a/hosts/mantis/niri-config.kdl b/hosts/mantis/niri-config.kdl
new file mode 100644
index 0000000..c2641e3
--- /dev/null
+++ b/hosts/mantis/niri-config.kdl
@@ -0,0 +1,470 @@
1// This config is in the KDL format: https://kdl.dev
2// "/-" comments out the following node.
3// Check the wiki for a full description of the configuration:
4// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
5
6// Input device configuration.
7// Find the full list of options on the wiki:
8// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
9input {
10 keyboard {
11 xkb {
12 // You can set rules, model, layout, variant and options.
13 // For more information, see xkeyboard-config(7).
14
15 // For example:
16 // layout "us,ru"
17 // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
18 }
19 }
20
21 // Next sections include libinput settings.
22 // Omitting settings disables them, or leaves them at their default values.
23 touchpad {
24 // off
25 tap
26 // dwt
27 // dwtp
28 natural-scroll
29 // accel-speed 0.2
30 // accel-profile "flat"
31 // scroll-method "two-finger"
32 // disabled-on-external-mouse
33 }
34
35 mouse {
36 // off
37 // natural-scroll
38 // accel-speed 0.2
39 // accel-profile "flat"
40 // scroll-method "no-scroll"
41 }
42
43 // Uncomment this to make the mouse warp to the center of newly focused windows.
44 warp-mouse-to-focus
45
46 // Focus windows and outputs automatically when moving the mouse into them.
47 // focus-follows-mouse
48}
49
50// You can configure outputs by their name, which you can find
51// by running `niri msg outputs` while inside a niri instance.
52// The built-in laptop monitor is usually called "eDP-1".
53// Find more information on the wiki:
54// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
55// Remember to uncomment the node by removing "/-"!
56output "DP-1" {
57 // Uncomment this line to disable this output.
58 // off
59
60 // Resolution and, optionally, refresh rate of the output.
61 // The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
62 // If the refresh rate is omitted, niri will pick the highest refresh rate
63 // for the resolution.
64 // If the mode is omitted altogether or is invalid, niri will pick one automatically.
65 // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
66 // mode "[email protected]"
67
68 // You can use integer or fractional scale, for example use 1.5 for 150% scale.
69 // scale 2
70
71 // Transform allows to rotate the output counter-clockwise, valid values are:
72 // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
73 // transform "270"
74
75 // Position of the output in the global coordinate space.
76 // This affects directional monitor actions like "focus-monitor-left", and cursor movement.
77 // The cursor can only move between directly adjacent outputs.
78 // Output scale and rotation has to be taken into account for positioning:
79 // outputs are sized in logical, or scaled, pixels.
80 // For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
81 // so to put another output directly adjacent to it on the right, set its x to 1920.
82 // If the position is unset or results in an overlap, the output is instead placed
83 // automatically.
84 // position x=1280 y=0
85}
86
87// Settings that influence how windows are positioned and sized.
88// Find more information on the wiki:
89// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
90layout {
91 // Set gaps around windows in logical pixels.
92 gaps 24
93
94 // When to center a column when changing focus, options are:
95 // - "never", default behavior, focusing an off-screen column will keep at the left
96 // or right edge of the screen.
97 // - "always", the focused column will always be centered.
98 // - "on-overflow", focusing a column will center it if it doesn't fit
99 // together with the previously focused column.
100 center-focused-column "never"
101
102 // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
103 preset-column-widths {
104 // Proportion sets the width as a fraction of the output width, taking gaps into account.
105 // For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
106 // The default preset widths are 1/3, 1/2 and 2/3 of the output.
107 proportion 0.3333
108 proportion 0.6666
109 proportion 1.0
110
111 // Fixed sets the width in logical pixels exactly.
112 // fixed 1920
113 }
114
115 // You can change the default width of the new windows.
116 default-column-width { proportion 0.3333; }
117 // If you leave the brackets empty, the windows themselves will decide their initial width.
118 // default-column-width {}
119
120 // By default focus ring and border are rendered as a solid background rectangle
121 // behind windows. That is, they will show up through semitransparent windows.
122 // This is because windows using client-side decorations can have an arbitrary shape.
123 //
124 // If you don't like that, you should uncomment `prefer-no-csd` below.
125 // Niri will draw focus ring and border *around* windows that agree to omit their
126 // client-side decorations.
127 //
128 // Alternatively, you can override it with a window rule called
129 // `draw-border-with-background`.
130
131 // You can change how the focus ring looks.
132 focus-ring {
133 // Uncomment this line to disable the focus ring.
134 off
135
136 // How many logical pixels the ring extends out from the windows.
137 width 5
138
139 // Colors can be set in a variety of ways:
140 // - CSS named colors: "red"
141 // - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
142 // - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
143
144 // Color of the ring on the active monitor.
145 active-color "#555555"
146
147 // Color of the ring on inactive monitors.
148 inactive-color "#222"
149
150 // You can also use gradients. They take precedence over solid colors.
151 // Gradients are rendered the same as CSS linear-gradient(angle, from, to).
152 // The angle is the same as in linear-gradient, and is optional,
153 // defaulting to 180 (top-to-bottom gradient).
154 // You can use any CSS linear-gradient tool on the web to set these up.
155 //
156 // active-gradient from="#FF5370" to="#79ffe1" angle=45
157
158 // You can also color the gradient relative to the entire view
159 // of the workspace, rather than relative to just the window itself.
160 // To do that, set relative-to="workspace-view".
161 //
162 // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
163 }
164
165 // You can also add a border. It's similar to the focus ring, but always visible.
166 border {
167 // The settings are the same as for the focus ring.
168 // If you enable the border, you probably want to disable the focus ring.
169 // off
170
171 width 1.5
172 inactive-color "#333333"
173 active-color "#777777"
174
175 // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
176 // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
177 }
178
179 // Struts shrink the area occupied by windows, similarly to layer-shell panels.
180 // You can think of them as a kind of outer gaps. They are set in logical pixels.
181 // Left and right struts will cause the next window to the side to always be visible.
182 // Top and bottom struts will simply add outer gaps in addition to the area occupied by
183 // layer-shell panels and regular gaps.
184 struts {
185 left 24
186 right 24
187 // top 64
188 // bottom 64
189 }
190}
191
192// Add lines like this to spawn processes at startup.
193// Note that running niri as a session supports xdg-desktop-autostart,
194// which may be more convenient to use.
195// See the binds section below for more spawn examples.
196// spawn-at-startup "alacritty" "-e" "fish"
197spawn-at-startup "swaybg" "-i" "/home/op/dloads/leaves3.png" "-m" "tile"
198spawn-at-startup "dunst"
199
200// Uncomment this line to ask the clients to omit their client-side decorations if possible.
201// If the client will specifically ask for CSD, the request will be honored.
202// Additionally, clients will be informed that they are tiled, removing some rounded corners.
203// prefer-no-csd
204
205// You can change the path where screenshots are saved.
206// A ~ at the front will be expanded to the home directory.
207// The path is formatted with strftime(3) to give you the screenshot date and time.
208screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
209
210// You can also set this to null to disable saving screenshots to disk.
211// screenshot-path null
212
213// Animation settings.
214// The wiki explains how to configure individual animations:
215// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
216animations {
217 // Uncomment to turn off all animations.
218 // off
219
220 // Slow down all animations by this factor. Values below 1 speed them up instead.
221 // slowdown 3.0
222}
223
224// Window rules let you adjust behavior for individual windows.
225// Find more information on the wiki:
226// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
227
228// Work around WezTerm's initial configure bug
229// by setting an empty default-column-width.
230window-rule {
231 // This regular expression is intentionally made as specific as possible,
232 // since this is the default config, and we want no false positives.
233 // You can get away with just app-id="wezterm" if you want.
234 match app-id=r#"^org\.wezfurlong\.wezterm$"#
235 default-column-width {}
236}
237
238// Example: block out two password managers from screen capture.
239// (This example rule is commented out with a "/-" in front.)
240/-window-rule {
241 match app-id=r#"^org\.keepassxc\.KeePassXC$"#
242 match app-id=r#"^org\.gnome\.World\.Secrets$"#
243
244 block-out-from "screen-capture"
245
246 // Use this instead if you want them visible on third-party screenshot tools.
247 // block-out-from "screencast"
248}
249
250binds {
251 // Keys consist of modifiers separated by + signs, followed by an XKB key name
252 // in the end. To find an XKB name for a particular key, you may use a program
253 // like wev.
254 //
255 // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
256 // when running as a winit window.
257 //
258 // Most actions that you can bind here can also be invoked programmatically with
259 // `niri msg action do-something`.
260
261 // Mod-Shift-/, which is usually the same as Mod-?,
262 // shows a list of important hotkeys.
263 Mod+Shift+Slash { show-hotkey-overlay; }
264
265 // Suggested binds for running programs: terminal, app launcher, screen locker.
266 Mod+Return { spawn "alacritty"; }
267 Mod+D { spawn "rofi" "-show" "combi"; }
268 Super+Alt+L { spawn "swaylock"; }
269
270 // You can also use a shell. Do this if you need pipes, multiple commands, etc.
271 // Note: the entire command goes as a single argument in the end.
272 // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
273
274 // Example volume keys mappings for PipeWire & WirePlumber.
275 // The allow-when-locked=true property makes them work even when the session is locked.
276 XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; }
277 XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
278 XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
279 XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
280
281 Mod+Q { close-window; }
282
283 Mod+Left { focus-column-left; }
284 Mod+Down { focus-window-down; }
285 Mod+Up { focus-window-up; }
286 Mod+Right { focus-column-right; }
287 Mod+H { focus-column-left; }
288 Mod+N { focus-window-down; }
289 Mod+E { focus-window-up; }
290 Mod+I { focus-column-right; }
291
292 Mod+Shift+H { move-column-left; }
293 Mod+Shift+N { move-window-down; }
294 Mod+Shift+E { move-window-up; }
295 Mod+Shift+I { move-column-right; }
296 Mod+Ctrl+Shift+H { consume-or-expel-window-left; }
297 Mod+Ctrl+Shift+I { consume-or-expel-window-right; }
298 // Mod+Ctrl+H { move-column-left; }
299 // Mod+Ctrl+N { move-window-down; }
300 // Mod+Ctrl+E { move-window-up; }
301 // Mod+Ctrl+I { move-column-right; }
302
303 // Alternative commands that move across workspaces when reaching
304 // the first or last window in a column.
305 // Mod+J { focus-window-or-workspace-down; }
306 // Mod+K { focus-window-or-workspace-up; }
307 // Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
308 // Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
309
310 Mod+Shift+6 { focus-column-first; }
311 Mod+Shift+4 { focus-column-last; }
312 Mod+Ctrl+Home { move-column-to-first; }
313 Mod+Ctrl+End { move-column-to-last; }
314
315 // Mod+Shift+Left { focus-monitor-left; }
316 // Mod+Shift+Down { focus-monitor-down; }
317 // Mod+Shift+Up { focus-monitor-up; }
318 // Mod+Shift+Right { focus-monitor-right; }
319 // Mod+Shift+H { focus-monitor-left; }
320 // Mod+Shift+J { focus-monitor-down; }
321 // Mod+Shift+K { focus-monitor-up; }
322 // Mod+Shift+L { focus-monitor-right; }
323
324 // Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
325 // Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
326 // Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
327 // Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
328 // Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
329 // Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
330 // Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
331 // Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
332
333 // Alternatively, there are commands to move just a single window:
334 // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
335 // ...
336
337 // And you can also move a whole workspace to another monitor:
338 // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
339 // ...
340
341 // Mod+Page_Down { focus-workspace-down; }
342 // Mod+Page_Up { focus-workspace-up; }
343 // Mod+U { focus-workspace-down; }
344 // Mod+I { focus-workspace-up; }
345 // Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
346 // Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
347 // Mod+Ctrl+U { move-column-to-workspace-down; }
348 // Mod+Ctrl+I { move-column-to-workspace-up; }
349
350 // Alternatively, there are commands to move just a single window:
351 // Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
352 // ...
353
354 // Mod+Shift+Page_Down { move-workspace-down; }
355 // Mod+Shift+Page_Up { move-workspace-up; }
356 // Mod+Shift+U { move-workspace-down; }
357 // Mod+Shift+I { move-workspace-up; }
358
359 // You can bind mouse wheel scroll ticks using the following syntax.
360 // These binds will change direction based on the natural-scroll setting.
361 //
362 // To avoid scrolling through workspaces really fast, you can use
363 // the cooldown-ms property. The bind will be rate-limited to this value.
364 // You can set a cooldown on any bind, but it's most useful for the wheel.
365 Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
366 Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
367 Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
368 Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
369
370 Mod+WheelScrollRight { focus-column-right; }
371 Mod+WheelScrollLeft { focus-column-left; }
372 Mod+Ctrl+WheelScrollRight { move-column-right; }
373 Mod+Ctrl+WheelScrollLeft { move-column-left; }
374
375 // Usually scrolling up and down with Shift in applications results in
376 // horizontal scrolling; these binds replicate that.
377 Mod+Shift+WheelScrollDown { focus-column-right; }
378 Mod+Shift+WheelScrollUp { focus-column-left; }
379 Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
380 Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
381
382 // Similarly, you can bind touchpad scroll "ticks".
383 // Touchpad scrolling is continuous, so for these binds it is split into
384 // discrete intervals.
385 // These binds are also affected by touchpad's natural-scroll, so these
386 // example binds are "inverted", since we have natural-scroll enabled for
387 // touchpads by default.
388 // Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
389 // Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
390
391 // You can refer to workspaces by index. However, keep in mind that
392 // niri is a dynamic workspace system, so these commands are kind of
393 // "best effort". Trying to refer to a workspace index bigger than
394 // the current workspace count will instead refer to the bottommost
395 // (empty) workspace.
396 //
397 // For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
398 // will all refer to the 3rd workspace.
399 Mod+1 { focus-workspace 1; }
400 Mod+2 { focus-workspace 2; }
401 Mod+3 { focus-workspace 3; }
402 Mod+4 { focus-workspace 4; }
403 Mod+5 { focus-workspace 5; }
404 Mod+6 { focus-workspace 6; }
405 Mod+7 { focus-workspace 7; }
406 Mod+8 { focus-workspace 8; }
407 Mod+9 { focus-workspace 9; }
408 Mod+Ctrl+1 { move-column-to-workspace 1; }
409 Mod+Ctrl+2 { move-column-to-workspace 2; }
410 Mod+Ctrl+3 { move-column-to-workspace 3; }
411 Mod+Ctrl+4 { move-column-to-workspace 4; }
412 Mod+Ctrl+5 { move-column-to-workspace 5; }
413 Mod+Ctrl+6 { move-column-to-workspace 6; }
414 Mod+Ctrl+7 { move-column-to-workspace 7; }
415 Mod+Ctrl+8 { move-column-to-workspace 8; }
416 Mod+Ctrl+9 { move-column-to-workspace 9; }
417
418 // Alternatively, there are commands to move just a single window:
419 // Mod+Ctrl+1 { move-window-to-workspace 1; }
420
421 // Switches focus between the current and the previous workspace.
422 // Mod+Tab { focus-workspace-previous; }
423
424 Mod+Comma { consume-window-into-column; }
425 Mod+Period { expel-window-from-column; }
426
427 // There are also commands that consume or expel a single window to the side.
428 // Mod+BracketLeft { consume-or-expel-window-left; }
429 // Mod+BracketRight { consume-or-expel-window-right; }
430
431 Mod+R { switch-preset-column-width; }
432 Mod+Shift+R { reset-window-height; }
433 Mod+F { maximize-column; }
434 Mod+Shift+F { fullscreen-window; }
435 Mod+C { center-column; }
436
437 // Finer width adjustments.
438 // This command can also:
439 // * set width in pixels: "1000"
440 // * adjust width in pixels: "-5" or "+5"
441 // * set width as a percentage of screen width: "25%"
442 // * adjust width as a percentage of screen width: "-10%" or "+10%"
443 // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
444 // set-column-width "100" will make the column occupy 200 physical screen pixels.
445 Mod+G { set-column-width "+33.333%"; }
446 Mod+Shift+G { set-column-width "-33.333%"; }
447
448 // Finer height adjustments when in column with other windows.
449 Mod+Shift+Minus { set-window-height "-10%"; }
450 Mod+Shift+Equal { set-window-height "+10%"; }
451
452 // Actions to switch layouts.
453 // Note: if you uncomment these, make sure you do NOT have
454 // a matching layout switch hotkey configured in xkb options above.
455 // Having both at once on the same hotkey will break the switching,
456 // since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
457 // Mod+Space { switch-layout "next"; }
458 // Mod+Shift+Space { switch-layout "prev"; }
459
460 Print { screenshot; }
461 Ctrl+Print { screenshot-screen; }
462 Alt+Print { screenshot-window; }
463
464 // The quit action will show a confirmation dialog to avoid accidental exits.
465 Mod+Shift+Q { quit; }
466
467 // Powers off the monitors. To turn them back on, do any input like
468 // moving the mouse or pressing any other key.
469 Mod+Shift+P { power-off-monitors; }
470}