···11-// This config is in the KDL format: https://kdl.dev
22-// "/-" comments out the following node.
33-// Check the wiki for a full description of the configuration:
44-// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
55-debug {
66- wait-for-frame-completion-in-pipewire
77-}
11+debug { wait-for-frame-completion-in-pipewire; }
8299-// Input device configuration.
1010-// Find the full list of options on the wiki:
1111-// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
123input {
134 keyboard {
1414- xkb {
1515- layout "us"
1616- }
55+ xkb { layout "us"; }
176 }
1818- touchpad {
1919- off
2020- }
2121- mouse {
2222- // off
2323- // natural-scroll
2424- // accel-speed 0.2
2525- // accel-profile "flat"
2626- // scroll-method "no-scroll"
2727- }
2828- trackpoint {
2929- off
3030- }
3131- // Uncomment this to make the mouse warp to the center of newly focused windows.
3232- // warp-mouse-to-focus
3333- // Focus windows and outputs automatically when moving the mouse into them.
3434- // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
77+ touchpad { off; }
88+ trackpoint { off; }
359 focus-follows-mouse max-scroll-amount="0%"
3610}
3711···4822 position x=3840 y=0
4923}
50245151-// Settings that influence how windows are positioned and sized.
5252-// Find more information on the wiki:
5353-// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
5425layout {
5555- // Set gaps around windows in logical pixels.
5626 gaps 16
5757-5858- // When to center a column when changing focus, options are:
5959- // - "never", default behavior, focusing an off-screen column will keep at the left
6060- // or right edge of the screen.
6161- // - "always", the focused column will always be centered.
6262- // - "on-overflow", focusing a column will center it if it doesn't fit
6363- // together with the previously focused column.
6427 center-focused-column "never"
6565-6666- // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
6728 preset-column-widths {
6868- // Proportion sets the width as a fraction of the output width, taking gaps into account.
6969- // For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
7070- // The default preset widths are 1/3, 1/2 and 2/3 of the output.
7129 proportion 0.33333
7230 proportion 0.5
7331 proportion 0.66667
7474-7575- // Fixed sets the width in logical pixels exactly.
7676- // fixed 1920
7732 }
7878-7979- // You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
8080- // preset-window-heights { }
8181-8282- // You can change the default width of the new windows.
8333 default-column-width { proportion 0.5; }
8484- // If you leave the brackets empty, the windows themselves will decide their initial width.
8585- // default-column-width {}
8686-8787- // By default focus ring and border are rendered as a solid background rectangle
8888- // behind windows. That is, they will show up through semitransparent windows.
8989- // This is because windows using client-side decorations can have an arbitrary shape.
9090- //
9191- // If you don't like that, you should uncomment `prefer-no-csd` below.
9292- // Niri will draw focus ring and border *around* windows that agree to omit their
9393- // client-side decorations.
9494- //
9595- // Alternatively, you can override it with a window rule called
9696- // `draw-border-with-background`.
9797-9898- // You can change how the focus ring looks.
9934 focus-ring {
100100- // Uncomment this line to disable the focus ring.
101101- // off
102102-103103- // How many logical pixels the ring extends out from the windows.
10435 width 3
105105-106106- // Colors can be set in a variety of ways:
107107- // - CSS named colors: "red"
108108- // - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
109109- // - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
110110-111111- // Color of the ring on the active monitor.
112112- // active-color "#7fc8ff"
11336 active-color "#336699"
114114-115115- // Color of the ring on inactive monitors.
11637 inactive-color "#505050"
117117-118118- // You can also use gradients. They take precedence over solid colors.
119119- // Gradients are rendered the same as CSS linear-gradient(angle, from, to).
120120- // The angle is the same as in linear-gradient, and is optional,
121121- // defaulting to 180 (top-to-bottom gradient).
122122- // You can use any CSS linear-gradient tool on the web to set these up.
123123- // Changing the color space is also supported, check the wiki for more info.
124124- //
125125- // active-gradient from="#80c8ff" to="#bbddff" angle=45
126126-127127- // You can also color the gradient relative to the entire view
128128- // of the workspace, rather than relative to just the window itself.
129129- // To do that, set relative-to="workspace-view".
130130- //
131131- // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
13238 }
133133-134134- // You can also add a border. It's similar to the focus ring, but always visible.
13539 border {
136136- // The settings are the same as for the focus ring.
137137- // If you enable the border, you probably want to disable the focus ring.
13840 off
139139-14041 width 3
14142 active-color "#ffc87f"
14243 inactive-color "#505050"
143143-144144- // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
145145- // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
14644 }
147147-148148- // You can enable drop shadows for windows.
14945 shadow {
150150- // Uncomment the next line to enable shadows.
15146 on
152152-153153- // By default, the shadow draws only around its window, and not behind it.
154154- // Uncomment this setting to make the shadow draw behind its window.
155155- //
156156- // Note that niri has no way of knowing about the CSD window corner
157157- // radius. It has to assume that windows have square corners, leading to
158158- // shadow artifacts inside the CSD rounded corners. This setting fixes
159159- // those artifacts.
160160- //
161161- // However, instead you may want to set prefer-no-csd and/or
162162- // geometry-corner-radius. Then, niri will know the corner radius and
163163- // draw the shadow correctly, without having to draw it behind the
164164- // window. These will also remove client-side shadows if the window
165165- // draws any.
166166- //
167167- // draw-behind-window true
168168-169169- // You can change how shadows look. The values below are in logical
170170- // pixels and match the CSS box-shadow properties.
171171-172172- // Softness controls the shadow blur radius.
17347 softness 30
174174-175175- // Spread expands the shadow.
17648 spread 5
177177-178178- // Offset moves the shadow relative to the window.
17949 offset x=0 y=5
180180-181181- // You can also change the shadow color and opacity.
18250 color "#0007"
18351 }
184184-185185- // Struts shrink the area occupied by windows, similarly to layer-shell panels.
186186- // You can think of them as a kind of outer gaps. They are set in logical pixels.
187187- // Left and right struts will cause the next window to the side to always be visible.
188188- // Top and bottom struts will simply add outer gaps in addition to the area occupied by
189189- // layer-shell panels and regular gaps.
190190- struts {
191191- // left 64
192192- // right 64
193193- // top 64
194194- // bottom 64
195195- }
19652}
19753198198-// Add lines like this to spawn processes at startup.
199199-// Note that running niri as a session supports xdg-desktop-autostart,
200200-// which may be more convenient to use.
201201-// See the binds section below for more spawn examples.
202202-// spawn-at-startup "alacritty" "-e" "fish"
20354spawn-at-startup "xwayland-satellite"
204204-20555environment {
20656 DISPLAY ":0"
20757}
20858209209-// Uncomment this line to ask the clients to omit their client-side decorations if possible.
210210-// If the client will specifically ask for CSD, the request will be honored.
211211-// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
212212-// This option will also fix border/focus ring drawing behind some semitransparent windows.
213213-// After enabling or disabling this, you need to restart the apps for this to take effect.
214214-// prefer-no-csd
215215-216216-// You can change the path where screenshots are saved.
217217-// A ~ at the front will be expanded to the home directory.
218218-// The path is formatted with strftime(3) to give you the screenshot date and time.
219219-screenshot-path "~/Pictures/screenshots/screenshot-from-%Y-%m-%d-%H-%M-%S.png"
220220-221221-// You can also set this to null to disable saving screenshots to disk.
222222-// screenshot-path null
223223-224224-// Animation settings.
225225-// The wiki explains how to configure individual animations:
226226-// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
227227-animations {
228228- // Uncomment to turn off all animations.
229229- // off
230230-231231- // Slow down all animations by this factor. Values below 1 speed them up instead.
232232- // slowdown 3.0
233233-}
234234-235235-// Window rules let you adjust behavior for individual windows.
236236-// Find more information on the wiki:
237237-// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
238238-239239-// Work around WezTerm's initial configure bug
240240-// by setting an empty default-column-width.
24159window-rule {
242242- // This regular expression is intentionally made as specific as possible,
243243- // since this is the default config, and we want no false positives.
244244- // You can get away with just app-id="wezterm" if you want.
245245- match app-id=r#"^org\.wezfurlong\.wezterm$"#
246246- default-column-width {}
6060+ geometry-corner-radius 12
6161+ clip-to-geometry true
24762}
2486324964window-rule {
25065 match app-id=r#"^looking-glass-client$"#
251251- // open-maximized true
252252- open-floating true
253253- default-column-width { fixed 2560; }
254254- default-window-height { fixed 1440; }
6666+ default-column-width { fixed 3724; }
25567}
25668257257-// Open the Firefox picture-in-picture player as floating by default.
25869window-rule {
259259- // This app-id regular expression will work for both:
260260- // - host Firefox (app-id is "firefox")
261261- // - Flatpak Firefox (app-id is "org.mozilla.firefox")
26270 match app-id=r#"firefox$"# title="^Picture-in-Picture$"
26371 open-floating true
26472}
26573266266-// Example: block out two password managers from screen capture.
267267-// (This example rule is commented out with a "/-" in front.)
268268-/-window-rule {
269269- match app-id=r#"^org\.keepassxc\.KeePassXC$"#
270270- match app-id=r#"^org\.gnome\.World\.Secrets$"#
271271-272272- block-out-from "screen-capture"
7474+window-rule {
7575+ match app-id=r#"mpv|ffplay"#
7676+ open-floating true
7777+}
27378274274- // Use this instead if you want them visible on third-party screenshot tools.
275275- // block-out-from "screencast"
7979+window-rule {
8080+ match app-id=r#"^obs$"# title="Add|Create|Select|Properties"
8181+ open-floating true
27682}
27783278278-// Example: enable rounded corners for all windows.
279279-// (This example rule is commented out with a "/-" in front.)
28084window-rule {
281281- geometry-corner-radius 12
282282- clip-to-geometry true
8585+ match app-id=r#"firefox$"# title="tjh.dev Mail — Mozilla Firefox$|Gmail — Mozilla Firefox$"
8686+ block-out-from "screen-capture"
28387}
2848828589window-rule {
286286- match app-id=r#"^obs$"# title="Add|Create|Select|Properties"
287287- open-floating true
9090+ match app-id="1Password"
9191+ block-out-from "screen-capture"
28892}
2899329094window-rule {
···300104 }
301105}
302106303303-// Hide my emails
304304-window-rule {
305305- match app-id=r#"firefox$"# title="tjh.dev Mail — Mozilla Firefox$|Gmail — Mozilla Firefox$"
306306- block-out-from "screen-capture"
307307-}
308308-309309-window-rule {
310310- match app-id="1Password"
311311- block-out-from "screen-capture"
312312-}
313107314108binds {
315315- // Keys consist of modifiers separated by + signs, followed by an XKB key name
316316- // in the end. To find an XKB name for a particular key, you may use a program
317317- // like wev.
318318- //
319319- // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
320320- // when running as a winit window.
321321- //
322322- // Most actions that you can bind here can also be invoked programmatically with
323323- // `niri msg action do-something`.
324324-325325- // Mod-Shift-/, which is usually the same as Mod-?,
326326- // shows a list of important hotkeys.
327109 Mod+Shift+Slash { show-hotkey-overlay; }
328110329329- // Suggested binds for running programs: terminal, app launcher, screen locker.
330111 Mod+T { spawn "alacritty"; }
331112 Mod+D { spawn "fuzzel"; }
332332- // Mod+D { spawn "wofi" "--show" "drun"; }
113113+333114 Super+Alt+L { spawn "swaylock"; }
334115 Super+Alt+S { spawn "systemctl" "suspend"; }
335116336336- // You can also use a shell. Do this if you need pipes, multiple commands, etc.
337337- // Note: the entire command goes as a single argument in the end.
338338- // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
339339-340340- // Example volume keys mappings for PipeWire & WirePlumber.
341341- // The allow-when-locked=true property makes them work even when the session is locked.
342117 XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.005+"; }
343118 XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.005-"; }
344119 XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
···346121347122 Mod+Q { close-window; }
348123349349- // Mod+Left { focus-column-left; }
350350- // Mod+Down { focus-window-down; }
351351- // Mod+Up { focus-window-up; }
352352- // Mod+Right { focus-column-right; }
124124+ // Disable inhibiting so we can always escape from virt-viewer and looking-glass.
353125 Mod+H allow-inhibiting=false { focus-column-left; }
354354- Mod+J { focus-window-down; }
355355- Mod+K { focus-window-up; }
356126 Mod+L allow-inhibiting=false { focus-column-right; }
127127+ Mod+J { focus-window-down; }
128128+ Mod+K { focus-window-up; }
357129358358- // Mod+Ctrl+Left { move-column-left; }
359359- // Mod+Ctrl+Down { move-window-down; }
360360- // Mod+Ctrl+Up { move-window-up; }
361361- // Mod+Ctrl+Right { move-column-right; }
362130 Mod+Ctrl+H { move-column-left; }
131131+ Mod+Ctrl+L { move-column-right; }
363132 Mod+Ctrl+J { move-window-down; }
364133 Mod+Ctrl+K { move-window-up; }
365365- Mod+Ctrl+L { move-column-right; }
366366-367367- // Alternative commands that move across workspaces when reaching
368368- // the first or last window in a column.
369369- // Mod+J { focus-window-or-workspace-down; }
370370- // Mod+K { focus-window-or-workspace-up; }
371371- // Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
372372- // Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
373134374135 Mod+Home { focus-column-first; }
375136 Mod+End { focus-column-last; }
376137 Mod+Ctrl+Home { move-column-to-first; }
377138 Mod+Ctrl+End { move-column-to-last; }
378139379379- // Mod+Shift+Left { focus-monitor-left; }
380380- // Mod+Shift+Down { focus-monitor-down; }
381381- // Mod+Shift+Up { focus-monitor-up; }
382382- // Mod+Shift+Right { focus-monitor-right; }
383140 Mod+Shift+H { focus-monitor-left; }
384384- // Mod+Shift+J { focus-monitor-down; }
385385- // Mod+Shift+K { focus-monitor-up; }
386141 Mod+Shift+L { focus-monitor-right; }
387142388388- // Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
389389- // Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
390390- // Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
391391- // Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
392143 Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
393393- // Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
394394- // Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
395144 Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
396145397397- // Alternatively, there are commands to move just a single window:
398398- // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
399399- // ...
400400-401401- // And you can also move a whole workspace to another monitor:
402402- // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
403403- // ...
404404-405405- // Mod+Page_Down { focus-workspace-down; }
406406- // Mod+Page_Up { focus-workspace-up; }
146146+ // Disable inhibiting so we can always escape from virt-viewer and looking-glass.
407147 Mod+U allow-inhibiting=false { focus-workspace-down; }
408148 Mod+I allow-inhibiting=false { focus-workspace-up; }
409409- // Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
410410- // Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
149149+411150 Mod+Ctrl+U { move-column-to-workspace-down; }
412151 Mod+Ctrl+I { move-column-to-workspace-up; }
413152414414- // Alternatively, there are commands to move just a single window:
415415- // Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
416416- // ...
417417-418418- // Mod+Shift+Page_Down { move-workspace-down; }
419419- // Mod+Shift+Page_Up { move-workspace-up; }
420153 Mod+Shift+U { move-workspace-down; }
421154 Mod+Shift+I { move-workspace-up; }
422155423423- // You can bind mouse wheel scroll ticks using the following syntax.
424424- // These binds will change direction based on the natural-scroll setting.
425425- //
426426- // To avoid scrolling through workspaces really fast, you can use
427427- // the cooldown-ms property. The bind will be rate-limited to this value.
428428- // You can set a cooldown on any bind, but it's most useful for the wheel.
429156 Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
430157 Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
431158 Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
···436163 Mod+Ctrl+WheelScrollRight { move-column-right; }
437164 Mod+Ctrl+WheelScrollLeft { move-column-left; }
438165439439- // Usually scrolling up and down with Shift in applications results in
440440- // horizontal scrolling; these binds replicate that.
441166 Mod+Shift+WheelScrollDown { focus-column-right; }
442167 Mod+Shift+WheelScrollUp { focus-column-left; }
443168 Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
444169 Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
445170446446- // Similarly, you can bind touchpad scroll "ticks".
447447- // Touchpad scrolling is continuous, so for these binds it is split into
448448- // discrete intervals.
449449- // These binds are also affected by touchpad's natural-scroll, so these
450450- // example binds are "inverted", since we have natural-scroll enabled for
451451- // touchpads by default.
452452- // Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
453453- // Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
454454-455455- // You can refer to workspaces by index. However, keep in mind that
456456- // niri is a dynamic workspace system, so these commands are kind of
457457- // "best effort". Trying to refer to a workspace index bigger than
458458- // the current workspace count will instead refer to the bottommost
459459- // (empty) workspace.
460460- //
461461- // For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
462462- // will all refer to the 3rd workspace.
463171 Mod+1 { focus-workspace 1; }
464172 Mod+2 { focus-workspace 2; }
465173 Mod+3 { focus-workspace 3; }
···469177 Mod+7 { focus-workspace 7; }
470178 Mod+8 { focus-workspace 8; }
471179 Mod+9 { focus-workspace 9; }
180180+472181 Mod+Ctrl+1 { move-column-to-workspace 1; }
473182 Mod+Ctrl+2 { move-column-to-workspace 2; }
474183 Mod+Ctrl+3 { move-column-to-workspace 3; }
···479188 Mod+Ctrl+8 { move-column-to-workspace 8; }
480189 Mod+Ctrl+9 { move-column-to-workspace 9; }
481190482482- // Alternatively, there are commands to move just a single window:
483483- // Mod+Ctrl+1 { move-window-to-workspace 1; }
484484-485485- // Switches focus between the current and the previous workspace.
486486- // Mod+Tab { focus-workspace-previous; }
487487-488488- // The following binds move the focused window in and out of a column.
489489- // If the window is alone, they will consume it into the nearby column to the side.
490490- // If the window is already in a column, they will expel it out.
491191 Mod+N { consume-or-expel-window-left; }
492192 Mod+M { consume-or-expel-window-right; }
493493- Mod+BracketLeft { consume-or-expel-window-left; }
494494- Mod+BracketRight { consume-or-expel-window-right; }
495193496496- // Consume one window from the right to the bottom of the focused column.
497194 Mod+Comma { consume-window-into-column; }
498498- // Expel the bottom window from the focused column to the right.
499195 Mod+Period { expel-window-from-column; }
500196501197 Mod+R { switch-preset-column-width; }
···505201 Mod+Shift+F { fullscreen-window; }
506202 Mod+Ctrl+Shift+F { toggle-windowed-fullscreen; }
507203508508- // Expand the focused column to space not taken up by other fully visible columns.
509509- // Makes the column "fill the rest of the space".
510204 Mod+Ctrl+F { expand-column-to-available-width; }
511205512206 Mod+C { center-column; }
513207514514- // Finer width adjustments.
515515- // This command can also:
516516- // * set width in pixels: "1000"
517517- // * adjust width in pixels: "-5" or "+5"
518518- // * set width as a percentage of screen width: "25%"
519519- // * adjust width as a percentage of screen width: "-10%" or "+10%"
520520- // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
521521- // set-column-width "100" will make the column occupy 200 physical screen pixels.
522208 Mod+Minus { set-column-width "-10%"; }
523209 Mod+Equal { set-column-width "+10%"; }
524210525525- // Finer height adjustments when in column with other windows.
526211 Mod+Shift+Minus { set-window-height "-10%"; }
527212 Mod+Shift+Equal { set-window-height "+10%"; }
528213529529- // Move the focused window between the floating and the tiling layout.
530214 Mod+V { toggle-window-floating; }
531215 Mod+Shift+V { switch-focus-between-floating-and-tiling; }
532216533533- // Toggle tabbed column display mode.
534534- // Windows in this column will appear as vertical tabs,
535535- // rather than stacked on top of each other.
536217 Mod+W { toggle-column-tabbed-display; }
537218538538- // Actions to switch layouts.
539539- // Note: if you uncomment these, make sure you do NOT have
540540- // a matching layout switch hotkey configured in xkb options above.
541541- // Having both at once on the same hotkey will break the switching,
542542- // since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
543543- // Mod+Space { switch-layout "next"; }
544544- // Mod+Shift+Space { switch-layout "prev"; }
545545-546219 Print { screenshot; }
547220 Super+P { screenshot; }
548221 Ctrl+Print { screenshot-screen; }
549222 Alt+Print { screenshot-window; }
550223551551- // Applications such as remote-desktop clients and software KVM switches may
552552- // request that niri stops processing the keyboard shortcuts defined here
553553- // so they may, for example, forward the key presses as-is to a remote machine.
554554- // It's a good idea to bind an escape hatch to toggle the inhibitor,
555555- // so a buggy application can't hold your session hostage.
556556- //
557557- // The allow-inhibiting=false property can be applied to other binds as well,
558558- // which ensures niri always processes them, even when an inhibitor is active.
559224 Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
560225561561- // The quit action will show a confirmation dialog to avoid accidental exits.
562226 Mod+Shift+E { quit; }
563227 Ctrl+Alt+Delete { quit; }
564228565565- // Powers off the monitors. To turn them back on, do any input like
566566- // moving the mouse or pressing any other key.
567229 Mod+Shift+P { power-off-monitors; }
568230}