diff options
-rw-r--r-- | usecases/desktop/graphical.nix | 1 | ||||
-rw-r--r-- | usecases/desktop/graphical/niri.kdl | 570 | ||||
-rw-r--r-- | usecases/desktop/graphical/niri.nix | 30 |
3 files changed, 601 insertions, 0 deletions
diff --git a/usecases/desktop/graphical.nix b/usecases/desktop/graphical.nix index f038b06..7289af3 100644 --- a/usecases/desktop/graphical.nix +++ b/usecases/desktop/graphical.nix | |||
@@ -10,6 +10,7 @@ inputs: { | |||
10 | (import ./graphical/gtk.nix inputs) | 10 | (import ./graphical/gtk.nix inputs) |
11 | # ./graphical/librewolf.nix | 11 | # ./graphical/librewolf.nix |
12 | (import ./graphical/mpv.nix inputs) | 12 | (import ./graphical/mpv.nix inputs) |
13 | ./graphical/niri.nix | ||
13 | (import ./graphical/plymouth.nix inputs) | 14 | (import ./graphical/plymouth.nix inputs) |
14 | (import ./graphical/rofi.nix inputs) | 15 | (import ./graphical/rofi.nix inputs) |
15 | (import ./graphical/sway.nix inputs) | 16 | (import ./graphical/sway.nix inputs) |
diff --git a/usecases/desktop/graphical/niri.kdl b/usecases/desktop/graphical/niri.kdl new file mode 100644 index 0000000..f9ead23 --- /dev/null +++ b/usecases/desktop/graphical/niri.kdl | |||
@@ -0,0 +1,570 @@ | |||
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 | ||
9 | input { | ||
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 | options "compose:caps" | ||
19 | } | ||
20 | } | ||
21 | |||
22 | // Next sections include libinput settings. | ||
23 | // Omitting settings disables them, or leaves them at their default values. | ||
24 | touchpad { | ||
25 | // off | ||
26 | tap | ||
27 | // dwt | ||
28 | // dwtp | ||
29 | // drag-lock | ||
30 | natural-scroll | ||
31 | // accel-speed 0.2 | ||
32 | // accel-profile "flat" | ||
33 | // scroll-method "two-finger" | ||
34 | // disabled-on-external-mouse | ||
35 | } | ||
36 | |||
37 | mouse { | ||
38 | // off | ||
39 | // natural-scroll | ||
40 | // accel-speed 0.2 | ||
41 | // accel-profile "flat" | ||
42 | // scroll-method "no-scroll" | ||
43 | } | ||
44 | |||
45 | trackpoint { | ||
46 | // off | ||
47 | // natural-scroll | ||
48 | // accel-speed 0.2 | ||
49 | // accel-profile "flat" | ||
50 | // scroll-method "on-button-down" | ||
51 | // scroll-button 273 | ||
52 | // middle-emulation | ||
53 | } | ||
54 | |||
55 | // Uncomment this to make the mouse warp to the center of newly focused windows. | ||
56 | // warp-mouse-to-focus | ||
57 | |||
58 | // Allow focus-follows-mouse when it results in scrolling at most 10% of the screen. | ||
59 | focus-follows-mouse max-scroll-amount="10%" | ||
60 | } | ||
61 | |||
62 | // You can configure outputs by their name, which you can find | ||
63 | // by running `niri msg outputs` while inside a niri instance. | ||
64 | // The built-in laptop monitor is usually called "eDP-1". | ||
65 | // Find more information on the wiki: | ||
66 | // https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs | ||
67 | // Remember to uncomment the node by removing "/-"! | ||
68 | /-output "eDP-1" { | ||
69 | // Uncomment this line to disable this output. | ||
70 | // off | ||
71 | |||
72 | // Resolution and, optionally, refresh rate of the output. | ||
73 | // The format is "<width>x<height>" or "<width>x<height>@<refresh rate>". | ||
74 | // If the refresh rate is omitted, niri will pick the highest refresh rate | ||
75 | // for the resolution. | ||
76 | // If the mode is omitted altogether or is invalid, niri will pick one automatically. | ||
77 | // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes. | ||
78 | mode "1920x1080@120.030" | ||
79 | |||
80 | // You can use integer or fractional scale, for example use 1.5 for 150% scale. | ||
81 | scale 2 | ||
82 | |||
83 | // Transform allows to rotate the output counter-clockwise, valid values are: | ||
84 | // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. | ||
85 | transform "normal" | ||
86 | |||
87 | // Position of the output in the global coordinate space. | ||
88 | // This affects directional monitor actions like "focus-monitor-left", and cursor movement. | ||
89 | // The cursor can only move between directly adjacent outputs. | ||
90 | // Output scale and rotation has to be taken into account for positioning: | ||
91 | // outputs are sized in logical, or scaled, pixels. | ||
92 | // For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080, | ||
93 | // so to put another output directly adjacent to it on the right, set its x to 1920. | ||
94 | // If the position is unset or results in an overlap, the output is instead placed | ||
95 | // automatically. | ||
96 | position x=1280 y=0 | ||
97 | } | ||
98 | |||
99 | // Settings that influence how windows are positioned and sized. | ||
100 | // Find more information on the wiki: | ||
101 | // https://github.com/YaLTeR/niri/wiki/Configuration:-Layout | ||
102 | layout { | ||
103 | // Set gaps around windows in logical pixels. | ||
104 | gaps 16 | ||
105 | |||
106 | // When to center a column when changing focus, options are: | ||
107 | // - "never", default behavior, focusing an off-screen column will keep at the left | ||
108 | // or right edge of the screen. | ||
109 | // - "always", the focused column will always be centered. | ||
110 | // - "on-overflow", focusing a column will center it if it doesn't fit | ||
111 | // together with the previously focused column. | ||
112 | center-focused-column "never" | ||
113 | |||
114 | // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between. | ||
115 | preset-column-widths { | ||
116 | // Proportion sets the width as a fraction of the output width, taking gaps into account. | ||
117 | // For example, you can perfectly fit four windows sized "proportion 0.25" on an output. | ||
118 | // The default preset widths are 1/3, 1/2 and 2/3 of the output. | ||
119 | proportion 0.33333 | ||
120 | proportion 0.5 | ||
121 | proportion 0.66667 | ||
122 | |||
123 | // Fixed sets the width in logical pixels exactly. | ||
124 | // fixed 1920 | ||
125 | } | ||
126 | |||
127 | // You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between. | ||
128 | // preset-window-heights { } | ||
129 | |||
130 | // You can change the default width of the new windows. | ||
131 | default-column-width { proportion 0.5; } | ||
132 | // If you leave the brackets empty, the windows themselves will decide their initial width. | ||
133 | // default-column-width {} | ||
134 | |||
135 | // By default focus ring and border are rendered as a solid background rectangle | ||
136 | // behind windows. That is, they will show up through semitransparent windows. | ||
137 | // This is because windows using client-side decorations can have an arbitrary shape. | ||
138 | // | ||
139 | // If you don't like that, you should uncomment `prefer-no-csd` below. | ||
140 | // Niri will draw focus ring and border *around* windows that agree to omit their | ||
141 | // client-side decorations. | ||
142 | // | ||
143 | // Alternatively, you can override it with a window rule called | ||
144 | // `draw-border-with-background`. | ||
145 | |||
146 | // You can change how the focus ring looks. | ||
147 | focus-ring { | ||
148 | // Uncomment this line to disable the focus ring. | ||
149 | // off | ||
150 | |||
151 | // How many logical pixels the ring extends out from the windows. | ||
152 | width 4 | ||
153 | |||
154 | // Colors can be set in a variety of ways: | ||
155 | // - CSS named colors: "red" | ||
156 | // - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa" | ||
157 | // - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others. | ||
158 | |||
159 | // Color of the ring on the active monitor. | ||
160 | active-color "#7fc8ff" | ||
161 | |||
162 | // Color of the ring on inactive monitors. | ||
163 | inactive-color "#505050" | ||
164 | |||
165 | // You can also use gradients. They take precedence over solid colors. | ||
166 | // Gradients are rendered the same as CSS linear-gradient(angle, from, to). | ||
167 | // The angle is the same as in linear-gradient, and is optional, | ||
168 | // defaulting to 180 (top-to-bottom gradient). | ||
169 | // You can use any CSS linear-gradient tool on the web to set these up. | ||
170 | // Changing the color space is also supported, check the wiki for more info. | ||
171 | // | ||
172 | // active-gradient from="#80c8ff" to="#bbddff" angle=45 | ||
173 | |||
174 | // You can also color the gradient relative to the entire view | ||
175 | // of the workspace, rather than relative to just the window itself. | ||
176 | // To do that, set relative-to="workspace-view". | ||
177 | // | ||
178 | // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" | ||
179 | } | ||
180 | |||
181 | // You can also add a border. It's similar to the focus ring, but always visible. | ||
182 | border { | ||
183 | // The settings are the same as for the focus ring. | ||
184 | // If you enable the border, you probably want to disable the focus ring. | ||
185 | off | ||
186 | |||
187 | width 4 | ||
188 | active-color "#ffc87f" | ||
189 | inactive-color "#505050" | ||
190 | |||
191 | // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view" | ||
192 | // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" | ||
193 | } | ||
194 | |||
195 | // You can enable drop shadows for windows. | ||
196 | shadow { | ||
197 | // Uncomment the next line to enable shadows. | ||
198 | on | ||
199 | |||
200 | // By default, the shadow draws only around its window, and not behind it. | ||
201 | // Uncomment this setting to make the shadow draw behind its window. | ||
202 | // | ||
203 | // Note that niri has no way of knowing about the CSD window corner | ||
204 | // radius. It has to assume that windows have square corners, leading to | ||
205 | // shadow artifacts inside the CSD rounded corners. This setting fixes | ||
206 | // those artifacts. | ||
207 | // | ||
208 | // However, instead you may want to set prefer-no-csd and/or | ||
209 | // geometry-corner-radius. Then, niri will know the corner radius and | ||
210 | // draw the shadow correctly, without having to draw it behind the | ||
211 | // window. These will also remove client-side shadows if the window | ||
212 | // draws any. | ||
213 | // | ||
214 | // draw-behind-window true | ||
215 | |||
216 | // You can change how shadows look. The values below are in logical | ||
217 | // pixels and match the CSS box-shadow properties. | ||
218 | |||
219 | // Softness controls the shadow blur radius. | ||
220 | softness 30 | ||
221 | |||
222 | // Spread expands the shadow. | ||
223 | spread 5 | ||
224 | |||
225 | // Offset moves the shadow relative to the window. | ||
226 | offset x=0 y=5 | ||
227 | |||
228 | // You can also change the shadow color and opacity. | ||
229 | color "#0007" | ||
230 | } | ||
231 | |||
232 | // Struts shrink the area occupied by windows, similarly to layer-shell panels. | ||
233 | // You can think of them as a kind of outer gaps. They are set in logical pixels. | ||
234 | // Left and right struts will cause the next window to the side to always be visible. | ||
235 | // Top and bottom struts will simply add outer gaps in addition to the area occupied by | ||
236 | // layer-shell panels and regular gaps. | ||
237 | struts { | ||
238 | // left 64 | ||
239 | // right 64 | ||
240 | // top 64 | ||
241 | // bottom 64 | ||
242 | } | ||
243 | } | ||
244 | |||
245 | // Add lines like this to spawn processes at startup. | ||
246 | // Note that running niri as a session supports xdg-desktop-autostart, | ||
247 | // which may be more convenient to use. | ||
248 | // See the binds section below for more spawn examples. | ||
249 | // spawn-at-startup "alacritty" "-e" "fish" | ||
250 | |||
251 | // Uncomment this line to ask the clients to omit their client-side decorations if possible. | ||
252 | // If the client will specifically ask for CSD, the request will be honored. | ||
253 | // Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. | ||
254 | // This option will also fix border/focus ring drawing behind some semitransparent windows. | ||
255 | // After enabling or disabling this, you need to restart the apps for this to take effect. | ||
256 | // prefer-no-csd | ||
257 | |||
258 | // You can change the path where screenshots are saved. | ||
259 | // A ~ at the front will be expanded to the home directory. | ||
260 | // The path is formatted with strftime(3) to give you the screenshot date and time. | ||
261 | screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" | ||
262 | |||
263 | // You can also set this to null to disable saving screenshots to disk. | ||
264 | // screenshot-path null | ||
265 | |||
266 | // Animation settings. | ||
267 | // The wiki explains how to configure individual animations: | ||
268 | // https://github.com/YaLTeR/niri/wiki/Configuration:-Animations | ||
269 | animations { | ||
270 | // Uncomment to turn off all animations. | ||
271 | // off | ||
272 | |||
273 | // Slow down all animations by this factor. Values below 1 speed them up instead. | ||
274 | // slowdown 3.0 | ||
275 | } | ||
276 | |||
277 | // Window rules let you adjust behavior for individual windows. | ||
278 | // Find more information on the wiki: | ||
279 | // https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules | ||
280 | |||
281 | // Work around WezTerm's initial configure bug | ||
282 | // by setting an empty default-column-width. | ||
283 | window-rule { | ||
284 | // This regular expression is intentionally made as specific as possible, | ||
285 | // since this is the default config, and we want no false positives. | ||
286 | // You can get away with just app-id="wezterm" if you want. | ||
287 | match app-id=r#"^org\.wezfurlong\.wezterm$"# | ||
288 | default-column-width {} | ||
289 | } | ||
290 | |||
291 | // Open the Firefox picture-in-picture player as floating by default. | ||
292 | window-rule { | ||
293 | // This app-id regular expression will work for both: | ||
294 | // - host Firefox (app-id is "firefox") | ||
295 | // - Flatpak Firefox (app-id is "org.mozilla.firefox") | ||
296 | match app-id=r#"firefox$"# title="^Picture-in-Picture$" | ||
297 | open-floating true | ||
298 | } | ||
299 | |||
300 | // Example: block out two password managers from screen capture. | ||
301 | // (This example rule is commented out with a "/-" in front.) | ||
302 | /-window-rule { | ||
303 | match app-id=r#"^org\.keepassxc\.KeePassXC$"# | ||
304 | match app-id=r#"^org\.gnome\.World\.Secrets$"# | ||
305 | |||
306 | block-out-from "screen-capture" | ||
307 | |||
308 | // Use this instead if you want them visible on third-party screenshot tools. | ||
309 | // block-out-from "screencast" | ||
310 | } | ||
311 | |||
312 | // Example: enable rounded corners for all windows. | ||
313 | // (This example rule is commented out with a "/-" in front.) | ||
314 | /-window-rule { | ||
315 | geometry-corner-radius 12 | ||
316 | clip-to-geometry true | ||
317 | } | ||
318 | |||
319 | binds { | ||
320 | // Keys consist of modifiers separated by + signs, followed by an XKB key name | ||
321 | // in the end. To find an XKB name for a particular key, you may use a program | ||
322 | // like wev. | ||
323 | // | ||
324 | // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt | ||
325 | // when running as a winit window. | ||
326 | // | ||
327 | // Most actions that you can bind here can also be invoked programmatically with | ||
328 | // `niri msg action do-something`. | ||
329 | |||
330 | // Mod-Shift-/, which is usually the same as Mod-?, | ||
331 | // shows a list of important hotkeys. | ||
332 | Mod+Shift+Slash { show-hotkey-overlay; } | ||
333 | |||
334 | // Suggested binds for running programs: terminal, app launcher, screen locker. | ||
335 | Mod+T { spawn "ghostty"; } | ||
336 | Mod+D { spawn "walker"; } | ||
337 | Super+Alt+L { spawn "swaylock"; } | ||
338 | |||
339 | Mod+Period { spawn "swaync-client" "-t"; } | ||
340 | |||
341 | // You can also use a shell. Do this if you need pipes, multiple commands, etc. | ||
342 | // Note: the entire command goes as a single argument in the end. | ||
343 | // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } | ||
344 | |||
345 | // Example volume keys mappings for PipeWire & WirePlumber. | ||
346 | // The allow-when-locked=true property makes them work even when the session is locked. | ||
347 | XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } | ||
348 | XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } | ||
349 | XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } | ||
350 | XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } | ||
351 | |||
352 | Mod+Q { close-window; } | ||
353 | |||
354 | Mod+Left { focus-column-left; } | ||
355 | Mod+Down { focus-window-down; } | ||
356 | Mod+Up { focus-window-up; } | ||
357 | Mod+Right { focus-column-right; } | ||
358 | Mod+H { focus-column-left; } | ||
359 | Mod+J { focus-window-down; } | ||
360 | Mod+K { focus-window-up; } | ||
361 | Mod+L { focus-column-right; } | ||
362 | |||
363 | Mod+Ctrl+Left { move-column-left; } | ||
364 | Mod+Ctrl+Down { move-window-down; } | ||
365 | Mod+Ctrl+Up { move-window-up; } | ||
366 | Mod+Ctrl+Right { move-column-right; } | ||
367 | Mod+Ctrl+H { move-column-left; } | ||
368 | Mod+Ctrl+J { move-window-down; } | ||
369 | Mod+Ctrl+K { move-window-up; } | ||
370 | Mod+Ctrl+L { move-column-right; } | ||
371 | |||
372 | // Alternative commands that move across workspaces when reaching | ||
373 | // the first or last window in a column. | ||
374 | // Mod+J { focus-window-or-workspace-down; } | ||
375 | // Mod+K { focus-window-or-workspace-up; } | ||
376 | // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } | ||
377 | // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } | ||
378 | |||
379 | Mod+Home { focus-column-first; } | ||
380 | Mod+End { focus-column-last; } | ||
381 | Mod+Ctrl+Home { move-column-to-first; } | ||
382 | Mod+Ctrl+End { move-column-to-last; } | ||
383 | |||
384 | Mod+Shift+Left { focus-monitor-left; } | ||
385 | Mod+Shift+Down { focus-monitor-down; } | ||
386 | Mod+Shift+Up { focus-monitor-up; } | ||
387 | Mod+Shift+Right { focus-monitor-right; } | ||
388 | Mod+Shift+H { focus-monitor-left; } | ||
389 | Mod+Shift+J { focus-monitor-down; } | ||
390 | Mod+Shift+K { focus-monitor-up; } | ||
391 | Mod+Shift+L { focus-monitor-right; } | ||
392 | |||
393 | Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } | ||
394 | Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } | ||
395 | Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } | ||
396 | Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } | ||
397 | Mod+Shift+Ctrl+H { move-column-to-monitor-left; } | ||
398 | Mod+Shift+Ctrl+J { move-column-to-monitor-down; } | ||
399 | Mod+Shift+Ctrl+K { move-column-to-monitor-up; } | ||
400 | Mod+Shift+Ctrl+L { move-column-to-monitor-right; } | ||
401 | |||
402 | // Alternatively, there are commands to move just a single window: | ||
403 | // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } | ||
404 | // ... | ||
405 | |||
406 | // And you can also move a whole workspace to another monitor: | ||
407 | // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } | ||
408 | // ... | ||
409 | |||
410 | Mod+Page_Down { focus-workspace-down; } | ||
411 | Mod+Page_Up { focus-workspace-up; } | ||
412 | Mod+U { focus-workspace-down; } | ||
413 | Mod+I { focus-workspace-up; } | ||
414 | Mod+Ctrl+Page_Down { move-column-to-workspace-down; } | ||
415 | Mod+Ctrl+Page_Up { move-column-to-workspace-up; } | ||
416 | Mod+Ctrl+U { move-column-to-workspace-down; } | ||
417 | Mod+Ctrl+I { move-column-to-workspace-up; } | ||
418 | |||
419 | // Alternatively, there are commands to move just a single window: | ||
420 | // Mod+Ctrl+Page_Down { move-window-to-workspace-down; } | ||
421 | // ... | ||
422 | |||
423 | Mod+Shift+Page_Down { move-workspace-down; } | ||
424 | Mod+Shift+Page_Up { move-workspace-up; } | ||
425 | Mod+Shift+U { move-workspace-down; } | ||
426 | Mod+Shift+I { move-workspace-up; } | ||
427 | |||
428 | // You can bind mouse wheel scroll ticks using the following syntax. | ||
429 | // These binds will change direction based on the natural-scroll setting. | ||
430 | // | ||
431 | // To avoid scrolling through workspaces really fast, you can use | ||
432 | // the cooldown-ms property. The bind will be rate-limited to this value. | ||
433 | // You can set a cooldown on any bind, but it's most useful for the wheel. | ||
434 | Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } | ||
435 | Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } | ||
436 | Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } | ||
437 | Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } | ||
438 | |||
439 | Mod+WheelScrollRight { focus-column-right; } | ||
440 | Mod+WheelScrollLeft { focus-column-left; } | ||
441 | Mod+Ctrl+WheelScrollRight { move-column-right; } | ||
442 | Mod+Ctrl+WheelScrollLeft { move-column-left; } | ||
443 | |||
444 | // Usually scrolling up and down with Shift in applications results in | ||
445 | // horizontal scrolling; these binds replicate that. | ||
446 | Mod+Shift+WheelScrollDown { focus-column-right; } | ||
447 | Mod+Shift+WheelScrollUp { focus-column-left; } | ||
448 | Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } | ||
449 | Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } | ||
450 | |||
451 | // Similarly, you can bind touchpad scroll "ticks". | ||
452 | // Touchpad scrolling is continuous, so for these binds it is split into | ||
453 | // discrete intervals. | ||
454 | // These binds are also affected by touchpad's natural-scroll, so these | ||
455 | // example binds are "inverted", since we have natural-scroll enabled for | ||
456 | // touchpads by default. | ||
457 | // Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } | ||
458 | // Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } | ||
459 | |||
460 | // You can refer to workspaces by index. However, keep in mind that | ||
461 | // niri is a dynamic workspace system, so these commands are kind of | ||
462 | // "best effort". Trying to refer to a workspace index bigger than | ||
463 | // the current workspace count will instead refer to the bottommost | ||
464 | // (empty) workspace. | ||
465 | // | ||
466 | // For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on | ||
467 | // will all refer to the 3rd workspace. | ||
468 | Mod+1 { focus-workspace 1; } | ||
469 | Mod+2 { focus-workspace 2; } | ||
470 | Mod+3 { focus-workspace 3; } | ||
471 | Mod+4 { focus-workspace 4; } | ||
472 | Mod+5 { focus-workspace 5; } | ||
473 | Mod+6 { focus-workspace 6; } | ||
474 | Mod+7 { focus-workspace 7; } | ||
475 | Mod+8 { focus-workspace 8; } | ||
476 | Mod+9 { focus-workspace 9; } | ||
477 | Mod+Ctrl+1 { move-column-to-workspace 1; } | ||
478 | Mod+Ctrl+2 { move-column-to-workspace 2; } | ||
479 | Mod+Ctrl+3 { move-column-to-workspace 3; } | ||
480 | Mod+Ctrl+4 { move-column-to-workspace 4; } | ||
481 | Mod+Ctrl+5 { move-column-to-workspace 5; } | ||
482 | Mod+Ctrl+6 { move-column-to-workspace 6; } | ||
483 | Mod+Ctrl+7 { move-column-to-workspace 7; } | ||
484 | Mod+Ctrl+8 { move-column-to-workspace 8; } | ||
485 | Mod+Ctrl+9 { move-column-to-workspace 9; } | ||
486 | |||
487 | // Alternatively, there are commands to move just a single window: | ||
488 | // Mod+Ctrl+1 { move-window-to-workspace 1; } | ||
489 | |||
490 | // Switches focus between the current and the previous workspace. | ||
491 | // Mod+Tab { focus-workspace-previous; } | ||
492 | |||
493 | // The following binds move the focused window in and out of a column. | ||
494 | // If the window is alone, they will consume it into the nearby column to the side. | ||
495 | // If the window is already in a column, they will expel it out. | ||
496 | Mod+BracketLeft { consume-or-expel-window-left; } | ||
497 | Mod+BracketRight { consume-or-expel-window-right; } | ||
498 | |||
499 | // Consume one window from the right to the bottom of the focused column. | ||
500 | // TODO: | ||
501 | //Mod+Comma { consume-window-into-column; } | ||
502 | // Expel the bottom window from the focused column to the right. | ||
503 | //Mod+Period { expel-window-from-column; } | ||
504 | |||
505 | Mod+R { switch-preset-column-width; } | ||
506 | Mod+Shift+R { switch-preset-window-height; } | ||
507 | Mod+Ctrl+R { reset-window-height; } | ||
508 | Mod+F { maximize-column; } | ||
509 | Mod+Shift+F { fullscreen-window; } | ||
510 | |||
511 | // Expand the focused column to space not taken up by other fully visible columns. | ||
512 | // Makes the column "fill the rest of the space". | ||
513 | Mod+Ctrl+F { expand-column-to-available-width; } | ||
514 | |||
515 | Mod+C { center-column; } | ||
516 | |||
517 | // Finer width adjustments. | ||
518 | // This command can also: | ||
519 | // * set width in pixels: "1000" | ||
520 | // * adjust width in pixels: "-5" or "+5" | ||
521 | // * set width as a percentage of screen width: "25%" | ||
522 | // * adjust width as a percentage of screen width: "-10%" or "+10%" | ||
523 | // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, | ||
524 | // set-column-width "100" will make the column occupy 200 physical screen pixels. | ||
525 | Mod+Minus { set-column-width "-10%"; } | ||
526 | Mod+Equal { set-column-width "+10%"; } | ||
527 | |||
528 | // Finer height adjustments when in column with other windows. | ||
529 | Mod+Shift+Minus { set-window-height "-10%"; } | ||
530 | Mod+Shift+Equal { set-window-height "+10%"; } | ||
531 | |||
532 | // Move the focused window between the floating and the tiling layout. | ||
533 | Mod+V { toggle-window-floating; } | ||
534 | Mod+Shift+V { switch-focus-between-floating-and-tiling; } | ||
535 | |||
536 | // Toggle tabbed column display mode. | ||
537 | // Windows in this column will appear as vertical tabs, | ||
538 | // rather than stacked on top of each other. | ||
539 | Mod+W { toggle-column-tabbed-display; } | ||
540 | |||
541 | // Actions to switch layouts. | ||
542 | // Note: if you uncomment these, make sure you do NOT have | ||
543 | // a matching layout switch hotkey configured in xkb options above. | ||
544 | // Having both at once on the same hotkey will break the switching, | ||
545 | // since it will switch twice upon pressing the hotkey (once by xkb, once by niri). | ||
546 | // Mod+Space { switch-layout "next"; } | ||
547 | // Mod+Shift+Space { switch-layout "prev"; } | ||
548 | |||
549 | Print { screenshot; } | ||
550 | Ctrl+Print { screenshot-screen; } | ||
551 | Alt+Print { screenshot-window; } | ||
552 | |||
553 | // Applications such as remote-desktop clients and software KVM switches may | ||
554 | // request that niri stops processing the keyboard shortcuts defined here | ||
555 | // so they may, for example, forward the key presses as-is to a remote machine. | ||
556 | // It's a good idea to bind an escape hatch to toggle the inhibitor, | ||
557 | // so a buggy application can't hold your session hostage. | ||
558 | // | ||
559 | // The allow-inhibiting=false property can be applied to other binds as well, | ||
560 | // which ensures niri always processes them, even when an inhibitor is active. | ||
561 | Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } | ||
562 | |||
563 | // The quit action will show a confirmation dialog to avoid accidental exits. | ||
564 | Mod+Shift+E { quit; } | ||
565 | Ctrl+Alt+Delete { quit; } | ||
566 | |||
567 | // Powers off the monitors. To turn them back on, do any input like | ||
568 | // moving the mouse or pressing any other key. | ||
569 | Mod+Shift+P { power-off-monitors; } | ||
570 | } | ||
diff --git a/usecases/desktop/graphical/niri.nix b/usecases/desktop/graphical/niri.nix new file mode 100644 index 0000000..8550d4f --- /dev/null +++ b/usecases/desktop/graphical/niri.nix | |||
@@ -0,0 +1,30 @@ | |||
1 | { | ||
2 | config, | ||
3 | lib, | ||
4 | pkgs, | ||
5 | ... | ||
6 | }: | ||
7 | let | ||
8 | cfg = config.reborn.niri; | ||
9 | in | ||
10 | { | ||
11 | options.reborn.niri = { | ||
12 | enable = lib.mkEnableOption "Reborn niri config"; | ||
13 | }; | ||
14 | |||
15 | config = lib.mkIf cfg.enable { | ||
16 | reborn = { | ||
17 | greetd.enable = true; | ||
18 | swaylock.enable = true; | ||
19 | swaync.enable = true; | ||
20 | waybar.enable = true; | ||
21 | wlsunset.enable = true; | ||
22 | }; | ||
23 | |||
24 | programs.niri.enable = true; | ||
25 | |||
26 | environment.systemPackages = [ pkgs.walker ]; | ||
27 | |||
28 | home-manager.users.minijackson.xdg.configFile."niri/config.kdl".source = ./niri.kdl; | ||
29 | }; | ||
30 | } | ||