···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://yalter.github.io/niri/Configuration:-Introduction
55+66+// Input device configuration.
77+// Find the full list of options on the wiki:
88+// https://yalter.github.io/niri/Configuration:-Input
99+input {
1010+ keyboard {
1111+ xkb {
1212+ // You can set rules, model, layout, variant and options.
1313+ // For more information, see xkeyboard-config(7).
1414+1515+ // For example:
1616+ // layout "us,ru"
1717+ // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
1818+ options "compose:ralt"
1919+2020+ // If this section is empty, niri will fetch xkb settings
2121+ // from org.freedesktop.locale1. You can control these using
2222+ // localectl set-x11-keymap.
2323+ }
2424+2525+ // Enable numlock on startup, omitting this setting disables it.
2626+ // numlock
2727+ }
2828+2929+ touchpad {
3030+ // off
3131+ tap
3232+ // dwt
3333+ // dwtp
3434+ // drag false
3535+ // drag-lock
3636+ natural-scroll
3737+ // accel-speed 0.2
3838+ accel-profile "flat"
3939+ // scroll-method "two-finger"
4040+ // disabled-on-external-mouse
4141+ }
4242+4343+ mouse {
4444+ // off
4545+ // natural-scroll
4646+ // accel-speed 0.2
4747+ accel-profile "flat"
4848+ // scroll-method "no-scroll"
4949+ }
5050+5151+ trackpoint {
5252+ // off
5353+ // natural-scroll
5454+ // accel-speed 0.2
5555+ accel-profile "flat"
5656+ // scroll-method "on-button-down"
5757+ // scroll-button 273
5858+ // scroll-button-lock
5959+ // middle-emulation
6060+ }
6161+6262+ warp-mouse-to-focus
6363+ focus-follows-mouse
6464+6565+ mod-key "Super"
6666+ mod-key-nested "Alt"
6767+}
6868+6969+output "HDMI-A-2" {
7070+ mode "1920x1080@74.973"
7171+ scale 1
7272+}
7373+7474+output "DP-1" {
7575+ mode "1920x1080@165.009"
7676+ scale 1
7777+}
7878+7979+// Settings that influence how windows are positioned and sized.
8080+// Find more information on the wiki:
8181+// https://yalter.github.io/niri/Configuration:-Layout
8282+layout {
8383+ // Set gaps around windows in logical pixels.
8484+ gaps 0
8585+8686+ // When to center a column when changing focus, options are:
8787+ // - "never", default behavior, focusing an off-screen column will keep at the left
8888+ // or right edge of the screen.
8989+ // - "always", the focused column will always be centered.
9090+ // - "on-overflow", focusing a column will center it if it doesn't fit
9191+ // together with the previously focused column.
9292+ center-focused-column "never"
9393+9494+ // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
9595+ preset-column-widths {
9696+ // Proportion sets the width as a fraction of the output width, taking gaps into account.
9797+ // For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
9898+ // The default preset widths are 1/3, 1/2 and 2/3 of the output.
9999+ proportion 0.33333
100100+ proportion 0.5
101101+ proportion 0.66667
102102+103103+ // Fixed sets the width in logical pixels exactly.
104104+ // fixed 1920
105105+ }
106106+107107+ // default-column-width { proportion 1.0; }
108108+109109+ focus-ring { off; }
110110+ border { off; }
111111+ // shadow { off; }
112112+113113+ struts { }
114114+}
115115+116116+spawn-at-startup "swaybg" "-c" "000000"
117117+118118+hotkey-overlay {
119119+ // skip-at-startup
120120+}
121121+122122+prefer-no-csd
123123+124124+screenshot-path "~/shots/%Y-%m-%d_%H-%M-%S.png"
125125+126126+environment {
127127+ ELECTRON_OZONE_PLATFORM_HINT "auto"
128128+}
129129+130130+animations {
131131+ // off
132132+133133+ // Slow down all animations by this factor. Values below 1 speed them up instead.
134134+ slowdown 1.4
135135+}
136136+137137+// Open the Firefox picture-in-picture player as floating by default.
138138+window-rule {
139139+ // This app-id regular expression will work for both:
140140+ // - host Firefox (app-id is "firefox")
141141+ // - Flatpak Firefox (app-id is "org.mozilla.firefox")
142142+ match app-id=r#"firefox$"# title="^Picture-in-Picture$"
143143+ match app-id=r#"^tofi"#
144144+145145+ open-floating true
146146+}
147147+148148+window-rule {
149149+ match app-id=r#"^org\.keepassxc\.KeePassXC$"#
150150+ match app-id=r#"^org\.gnome\.World\.Secrets$"#
151151+ // match namespace="^notifications$"
152152+153153+ block-out-from "screen-capture"
154154+}
155155+156156+window-rule {
157157+ geometry-corner-radius 0
158158+ clip-to-geometry true
159159+}
160160+161161+binds {
162162+ Mod+Shift+Slash { show-hotkey-overlay; }
163163+164164+ Mod+Return hotkey-overlay-title="terminal: foot" { spawn "footclient"; }
165165+ Mod+D hotkey-overlay-title="launcher: wofi" { spawn "tofi-drun"; }
166166+167167+ Alt+S hotkey-overlay-title="screenshot screen" { screenshot-screen; }
168168+ Alt+Shift+S hotkey-overlay-title="screenshot" { screenshot; }
169169+170170+ XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; }
171171+ XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
172172+ XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
173173+ XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
174174+175175+ XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
176176+ XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; }
177177+178178+ Mod+O repeat=false { toggle-overview; }
179179+ Mod+Q cooldown-ms=50 { close-window; }
180180+181181+ Mod+Left { focus-column-left; }
182182+ Mod+Down { focus-window-down; }
183183+ Mod+Up { focus-window-up; }
184184+ Mod+Right { focus-column-right; }
185185+ Mod+H { focus-column-left; }
186186+ Mod+J { focus-window-down; }
187187+ Mod+K { focus-window-up; }
188188+ Mod+L { focus-column-right; }
189189+190190+ Mod+Shift+Left { move-column-left; }
191191+ Mod+Shift+Down { move-window-down; }
192192+ Mod+Shift+Up { move-window-up; }
193193+ Mod+Shift+Right { move-column-right; }
194194+ Mod+Shift+H { move-column-left; }
195195+ Mod+Shift+J { move-window-down; }
196196+ Mod+Shift+K { move-window-up; }
197197+ Mod+Shift+L { move-column-right; }
198198+199199+ // Alternative commands that move across workspaces when reaching
200200+ // the first or last window in a column.
201201+ // Mod+J { focus-window-or-workspace-down; }
202202+ // Mod+K { focus-window-or-workspace-up; }
203203+ // Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
204204+ // Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
205205+206206+ Mod+Home { focus-column-first; }
207207+ Mod+End { focus-column-last; }
208208+ Mod+Ctrl+Home { move-column-to-first; }
209209+ Mod+Ctrl+End { move-column-to-last; }
210210+211211+ Mod+Ctrl+Left { focus-monitor-left; }
212212+ Mod+Ctrl+Down { focus-monitor-down; }
213213+ Mod+Ctrl+Up { focus-monitor-up; }
214214+ Mod+Ctrl+Right { focus-monitor-right; }
215215+ Mod+Ctrl+H { focus-monitor-left; }
216216+ Mod+Ctrl+J { focus-monitor-down; }
217217+ Mod+Ctrl+K { focus-monitor-up; }
218218+ Mod+Ctrl+L { focus-monitor-right; }
219219+220220+ Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
221221+ Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
222222+ Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
223223+ Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
224224+ Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
225225+ Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
226226+ Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
227227+ Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
228228+229229+ Mod+Page_Down { focus-workspace-down; }
230230+ Mod+Page_Up { focus-workspace-up; }
231231+ //Mod+U { focus-workspace-down; }
232232+ //Mod+I { focus-workspace-up; }
233233+ Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
234234+ Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
235235+ //Mod+Ctrl+U { move-column-to-workspace-down; }
236236+ //Mod+Ctrl+I { move-column-to-workspace-up; }
237237+238238+ Mod+Shift+Page_Down { move-workspace-down; }
239239+ Mod+Shift+Page_Up { move-workspace-up; }
240240+ Mod+Shift+U { move-workspace-down; }
241241+ Mod+Shift+I { move-workspace-up; }
242242+243243+ // You can bind mouse wheel scroll ticks using the following syntax.
244244+ // These binds will change direction based on the natural-scroll setting.
245245+ //
246246+ // To avoid scrolling through workspaces really fast, you can use
247247+ // the cooldown-ms property. The bind will be rate-limited to this value.
248248+ // You can set a cooldown on any bind, but it's most useful for the wheel.
249249+ Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
250250+ Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
251251+ Mod+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
252252+ Mod+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
253253+254254+ // Usually scrolling up and down with Shift in applications results in
255255+ // horizontal scrolling; these binds replicate that.
256256+ Alt+WheelScrollDown { focus-column-right; }
257257+ Alt+WheelScrollUp { focus-column-left; }
258258+ Alt+Shift+WheelScrollDown { move-column-right; }
259259+ Alt+Shift+WheelScrollUp { move-column-left; }
260260+261261+ Mod+1 { focus-workspace 1; }
262262+ Mod+2 { focus-workspace 2; }
263263+ Mod+3 { focus-workspace 3; }
264264+ Mod+4 { focus-workspace 4; }
265265+ Mod+5 { focus-workspace 5; }
266266+ Mod+6 { focus-workspace 6; }
267267+ Mod+7 { focus-workspace 7; }
268268+ Mod+8 { focus-workspace 8; }
269269+ Mod+9 { focus-workspace 9; }
270270+ Mod+Ctrl+1 { move-column-to-workspace 1; }
271271+ Mod+Ctrl+2 { move-column-to-workspace 2; }
272272+ Mod+Ctrl+3 { move-column-to-workspace 3; }
273273+ Mod+Ctrl+4 { move-column-to-workspace 4; }
274274+ Mod+Ctrl+5 { move-column-to-workspace 5; }
275275+ Mod+Ctrl+6 { move-column-to-workspace 6; }
276276+ Mod+Ctrl+7 { move-column-to-workspace 7; }
277277+ Mod+Ctrl+8 { move-column-to-workspace 8; }
278278+ Mod+Ctrl+9 { move-column-to-workspace 9; }
279279+280280+ // Switches focus between the current and the previous workspace.
281281+ // Mod+Tab { focus-workspace-previous; }
282282+283283+ // The following binds move the focused window in and out of a column.
284284+ // If the window is alone, they will consume it into the nearby column to the side.
285285+ // If the window is already in a column, they will expel it out.
286286+ Mod+BracketLeft { consume-or-expel-window-left; }
287287+ Mod+BracketRight { consume-or-expel-window-right; }
288288+289289+ // Consume one window from the right to the bottom of the focused column.
290290+ Mod+Comma { consume-window-into-column; }
291291+ // Expel the bottom window from the focused column to the right.
292292+ Mod+Period { expel-window-from-column; }
293293+294294+ Mod+R { switch-preset-column-width; }
295295+ // Cycling through the presets in reverse order is also possible.
296296+ // Mod+R { switch-preset-column-width-back; }
297297+ Mod+Shift+R { switch-preset-window-height; }
298298+ Mod+Ctrl+R { reset-window-height; }
299299+ Mod+F { maximize-column; }
300300+ Mod+Shift+F { fullscreen-window; }
301301+302302+ // Expand the focused column to space not taken up by other fully visible columns.
303303+ // Makes the column "fill the rest of the space".
304304+ Mod+Ctrl+F { expand-column-to-available-width; }
305305+306306+ Mod+C { center-column; }
307307+308308+ // Center all fully visible columns on screen.
309309+ Mod+Ctrl+C { center-visible-columns; }
310310+311311+ // Finer width adjustments.
312312+ // This command can also:
313313+ // * set width in pixels: "1000"
314314+ // * adjust width in pixels: "-5" or "+5"
315315+ // * set width as a percentage of screen width: "25%"
316316+ // * adjust width as a percentage of screen width: "-10%" or "+10%"
317317+ // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
318318+ // set-column-width "100" will make the column occupy 200 physical screen pixels.
319319+ Mod+Minus { set-column-width "-10%"; }
320320+ Mod+Equal { set-column-width "+10%"; }
321321+322322+ // Finer height adjustments when in column with other windows.
323323+ Mod+Shift+Minus { set-window-height "-10%"; }
324324+ Mod+Shift+Equal { set-window-height "+10%"; }
325325+326326+ // Move the focused window between the floating and the tiling layout.
327327+ Mod+V { toggle-window-floating; }
328328+ Mod+Shift+V { switch-focus-between-floating-and-tiling; }
329329+330330+ // Toggle tabbed column display mode.
331331+ // Windows in this column will appear as vertical tabs,
332332+ // rather than stacked on top of each other.
333333+ Mod+W { toggle-column-tabbed-display; }
334334+335335+ // Actions to switch layouts.
336336+ // Note: if you uncomment these, make sure you do NOT have
337337+ // a matching layout switch hotkey configured in xkb options above.
338338+ // Having both at once on the same hotkey will break the switching,
339339+ // since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
340340+ // Mod+Space { switch-layout "next"; }
341341+ // Mod+Shift+Space { switch-layout "prev"; }
342342+343343+ // Applications such as remote-desktop clients and software KVM switches may
344344+ // request that niri stops processing the keyboard shortcuts defined here
345345+ // so they may, for example, forward the key presses as-is to a remote machine.
346346+ // It's a good idea to bind an escape hatch to toggle the inhibitor,
347347+ // so a buggy application can't hold your session hostage.
348348+ //
349349+ // The allow-inhibiting=false property can be applied to other binds as well,
350350+ // which ensures niri always processes them, even when an inhibitor is active.
351351+ Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
352352+353353+ // The quit action will show a confirmation dialog to avoid accidental exits.
354354+ Mod+Shift+E { quit; }
355355+ Ctrl+Alt+Delete { quit; }
356356+357357+ // Powers off the monitors. To turn them back on, do any input like
358358+ // moving the mouse or pressing any other key.
359359+ Mod+Shift+P { power-off-monitors; }
360360+}