···
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://yalter.github.io/niri/Configuration:-Introduction
6
+
// Input device configuration.
7
+
// Find the full list of options on the wiki:
8
+
// https://yalter.github.io/niri/Configuration:-Input
12
+
// You can set rules, model, layout, variant and options.
13
+
// For more information, see xkeyboard-config(7).
17
+
// options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
18
+
options "compose:ralt"
20
+
// If this section is empty, niri will fetch xkb settings
21
+
// from org.freedesktop.locale1. You can control these using
22
+
// localectl set-x11-keymap.
25
+
// Enable numlock on startup, omitting this setting disables it.
38
+
accel-profile "flat"
39
+
// scroll-method "two-finger"
40
+
// disabled-on-external-mouse
47
+
accel-profile "flat"
48
+
// scroll-method "no-scroll"
55
+
accel-profile "flat"
56
+
// scroll-method "on-button-down"
57
+
// scroll-button 273
58
+
// scroll-button-lock
66
+
mod-key-nested "Alt"
70
+
mode "1920x1080@74.973"
75
+
mode "1920x1080@165.009"
79
+
// Settings that influence how windows are positioned and sized.
80
+
// Find more information on the wiki:
81
+
// https://yalter.github.io/niri/Configuration:-Layout
83
+
// Set gaps around windows in logical pixels.
86
+
// When to center a column when changing focus, options are:
87
+
// - "never", default behavior, focusing an off-screen column will keep at the left
88
+
// or right edge of the screen.
89
+
// - "always", the focused column will always be centered.
90
+
// - "on-overflow", focusing a column will center it if it doesn't fit
91
+
// together with the previously focused column.
92
+
center-focused-column "never"
94
+
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
95
+
preset-column-widths {
96
+
// Proportion sets the width as a fraction of the output width, taking gaps into account.
97
+
// For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
98
+
// The default preset widths are 1/3, 1/2 and 2/3 of the output.
103
+
// Fixed sets the width in logical pixels exactly.
107
+
// default-column-width { proportion 1.0; }
109
+
focus-ring { off; }
116
+
spawn-at-startup "swaybg" "-c" "000000"
124
+
screenshot-path "~/shots/%Y-%m-%d_%H-%M-%S.png"
127
+
ELECTRON_OZONE_PLATFORM_HINT "auto"
133
+
// Slow down all animations by this factor. Values below 1 speed them up instead.
137
+
// Open the Firefox picture-in-picture player as floating by default.
139
+
// This app-id regular expression will work for both:
140
+
// - host Firefox (app-id is "firefox")
141
+
// - Flatpak Firefox (app-id is "org.mozilla.firefox")
142
+
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
143
+
match app-id=r#"^tofi"#
149
+
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
150
+
match app-id=r#"^org\.gnome\.World\.Secrets$"#
151
+
// match namespace="^notifications$"
153
+
block-out-from "screen-capture"
157
+
geometry-corner-radius 0
158
+
clip-to-geometry true
162
+
Mod+Shift+Slash { show-hotkey-overlay; }
164
+
Mod+Return hotkey-overlay-title="terminal: foot" { spawn "footclient"; }
165
+
Mod+D hotkey-overlay-title="launcher: wofi" { spawn "tofi-drun"; }
167
+
Alt+S hotkey-overlay-title="screenshot screen" { screenshot-screen; }
168
+
Alt+Shift+S hotkey-overlay-title="screenshot" { screenshot; }
170
+
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; }
171
+
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
172
+
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
173
+
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
175
+
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
176
+
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; }
178
+
Mod+O repeat=false { toggle-overview; }
179
+
Mod+Q cooldown-ms=50 { close-window; }
181
+
Mod+Left { focus-column-left; }
182
+
Mod+Down { focus-window-down; }
183
+
Mod+Up { focus-window-up; }
184
+
Mod+Right { focus-column-right; }
185
+
Mod+H { focus-column-left; }
186
+
Mod+J { focus-window-down; }
187
+
Mod+K { focus-window-up; }
188
+
Mod+L { focus-column-right; }
190
+
Mod+Shift+Left { move-column-left; }
191
+
Mod+Shift+Down { move-window-down; }
192
+
Mod+Shift+Up { move-window-up; }
193
+
Mod+Shift+Right { move-column-right; }
194
+
Mod+Shift+H { move-column-left; }
195
+
Mod+Shift+J { move-window-down; }
196
+
Mod+Shift+K { move-window-up; }
197
+
Mod+Shift+L { move-column-right; }
199
+
// Alternative commands that move across workspaces when reaching
200
+
// the first or last window in a column.
201
+
// Mod+J { focus-window-or-workspace-down; }
202
+
// Mod+K { focus-window-or-workspace-up; }
203
+
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
204
+
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
206
+
Mod+Home { focus-column-first; }
207
+
Mod+End { focus-column-last; }
208
+
Mod+Ctrl+Home { move-column-to-first; }
209
+
Mod+Ctrl+End { move-column-to-last; }
211
+
Mod+Ctrl+Left { focus-monitor-left; }
212
+
Mod+Ctrl+Down { focus-monitor-down; }
213
+
Mod+Ctrl+Up { focus-monitor-up; }
214
+
Mod+Ctrl+Right { focus-monitor-right; }
215
+
Mod+Ctrl+H { focus-monitor-left; }
216
+
Mod+Ctrl+J { focus-monitor-down; }
217
+
Mod+Ctrl+K { focus-monitor-up; }
218
+
Mod+Ctrl+L { focus-monitor-right; }
220
+
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
221
+
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
222
+
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
223
+
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
224
+
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
225
+
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
226
+
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
227
+
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
229
+
Mod+Page_Down { focus-workspace-down; }
230
+
Mod+Page_Up { focus-workspace-up; }
231
+
//Mod+U { focus-workspace-down; }
232
+
//Mod+I { focus-workspace-up; }
233
+
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
234
+
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
235
+
//Mod+Ctrl+U { move-column-to-workspace-down; }
236
+
//Mod+Ctrl+I { move-column-to-workspace-up; }
238
+
Mod+Shift+Page_Down { move-workspace-down; }
239
+
Mod+Shift+Page_Up { move-workspace-up; }
240
+
Mod+Shift+U { move-workspace-down; }
241
+
Mod+Shift+I { move-workspace-up; }
243
+
// You can bind mouse wheel scroll ticks using the following syntax.
244
+
// These binds will change direction based on the natural-scroll setting.
246
+
// To avoid scrolling through workspaces really fast, you can use
247
+
// the cooldown-ms property. The bind will be rate-limited to this value.
248
+
// You can set a cooldown on any bind, but it's most useful for the wheel.
249
+
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
250
+
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
251
+
Mod+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
252
+
Mod+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
254
+
// Usually scrolling up and down with Shift in applications results in
255
+
// horizontal scrolling; these binds replicate that.
256
+
Alt+WheelScrollDown { focus-column-right; }
257
+
Alt+WheelScrollUp { focus-column-left; }
258
+
Alt+Shift+WheelScrollDown { move-column-right; }
259
+
Alt+Shift+WheelScrollUp { move-column-left; }
261
+
Mod+1 { focus-workspace 1; }
262
+
Mod+2 { focus-workspace 2; }
263
+
Mod+3 { focus-workspace 3; }
264
+
Mod+4 { focus-workspace 4; }
265
+
Mod+5 { focus-workspace 5; }
266
+
Mod+6 { focus-workspace 6; }
267
+
Mod+7 { focus-workspace 7; }
268
+
Mod+8 { focus-workspace 8; }
269
+
Mod+9 { focus-workspace 9; }
270
+
Mod+Ctrl+1 { move-column-to-workspace 1; }
271
+
Mod+Ctrl+2 { move-column-to-workspace 2; }
272
+
Mod+Ctrl+3 { move-column-to-workspace 3; }
273
+
Mod+Ctrl+4 { move-column-to-workspace 4; }
274
+
Mod+Ctrl+5 { move-column-to-workspace 5; }
275
+
Mod+Ctrl+6 { move-column-to-workspace 6; }
276
+
Mod+Ctrl+7 { move-column-to-workspace 7; }
277
+
Mod+Ctrl+8 { move-column-to-workspace 8; }
278
+
Mod+Ctrl+9 { move-column-to-workspace 9; }
280
+
// Switches focus between the current and the previous workspace.
281
+
// Mod+Tab { focus-workspace-previous; }
283
+
// The following binds move the focused window in and out of a column.
284
+
// If the window is alone, they will consume it into the nearby column to the side.
285
+
// If the window is already in a column, they will expel it out.
286
+
Mod+BracketLeft { consume-or-expel-window-left; }
287
+
Mod+BracketRight { consume-or-expel-window-right; }
289
+
// Consume one window from the right to the bottom of the focused column.
290
+
Mod+Comma { consume-window-into-column; }
291
+
// Expel the bottom window from the focused column to the right.
292
+
Mod+Period { expel-window-from-column; }
294
+
Mod+R { switch-preset-column-width; }
295
+
// Cycling through the presets in reverse order is also possible.
296
+
// Mod+R { switch-preset-column-width-back; }
297
+
Mod+Shift+R { switch-preset-window-height; }
298
+
Mod+Ctrl+R { reset-window-height; }
299
+
Mod+F { maximize-column; }
300
+
Mod+Shift+F { fullscreen-window; }
302
+
// Expand the focused column to space not taken up by other fully visible columns.
303
+
// Makes the column "fill the rest of the space".
304
+
Mod+Ctrl+F { expand-column-to-available-width; }
306
+
Mod+C { center-column; }
308
+
// Center all fully visible columns on screen.
309
+
Mod+Ctrl+C { center-visible-columns; }
311
+
// Finer width adjustments.
312
+
// This command can also:
313
+
// * set width in pixels: "1000"
314
+
// * adjust width in pixels: "-5" or "+5"
315
+
// * set width as a percentage of screen width: "25%"
316
+
// * adjust width as a percentage of screen width: "-10%" or "+10%"
317
+
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
318
+
// set-column-width "100" will make the column occupy 200 physical screen pixels.
319
+
Mod+Minus { set-column-width "-10%"; }
320
+
Mod+Equal { set-column-width "+10%"; }
322
+
// Finer height adjustments when in column with other windows.
323
+
Mod+Shift+Minus { set-window-height "-10%"; }
324
+
Mod+Shift+Equal { set-window-height "+10%"; }
326
+
// Move the focused window between the floating and the tiling layout.
327
+
Mod+V { toggle-window-floating; }
328
+
Mod+Shift+V { switch-focus-between-floating-and-tiling; }
330
+
// Toggle tabbed column display mode.
331
+
// Windows in this column will appear as vertical tabs,
332
+
// rather than stacked on top of each other.
333
+
Mod+W { toggle-column-tabbed-display; }
335
+
// Actions to switch layouts.
336
+
// Note: if you uncomment these, make sure you do NOT have
337
+
// a matching layout switch hotkey configured in xkb options above.
338
+
// Having both at once on the same hotkey will break the switching,
339
+
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
340
+
// Mod+Space { switch-layout "next"; }
341
+
// Mod+Shift+Space { switch-layout "prev"; }
343
+
// Applications such as remote-desktop clients and software KVM switches may
344
+
// request that niri stops processing the keyboard shortcuts defined here
345
+
// so they may, for example, forward the key presses as-is to a remote machine.
346
+
// It's a good idea to bind an escape hatch to toggle the inhibitor,
347
+
// so a buggy application can't hold your session hostage.
349
+
// The allow-inhibiting=false property can be applied to other binds as well,
350
+
// which ensures niri always processes them, even when an inhibitor is active.
351
+
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
353
+
// The quit action will show a confirmation dialog to avoid accidental exits.
354
+
Mod+Shift+E { quit; }
355
+
Ctrl+Alt+Delete { quit; }
357
+
// Powers off the monitors. To turn them back on, do any input like
358
+
// moving the mouse or pressing any other key.
359
+
Mod+Shift+P { power-off-monitors; }