niri default configuration
0
config.kdl
221 lines 7.4 kB view raw
1input { 2 keyboard { 3 xkb { 4 layout "no" 5 variant "winkeys" 6 } 7 8 numlock 9 } 10 11 touchpad { 12 off 13 natural-scroll 14 } 15 16 mouse { } 17 18 trackpoint { } 19 20 warp-mouse-to-focus 21 focus-follows-mouse max-scroll-amount="0%" 22} 23 24layout { 25 gaps 16 26 center-focused-column "never" 27 preset-column-widths { 28 proportion 0.33333 29 proportion 0.5 30 proportion 0.66667 31 } 32 default-column-width { proportion 0.33; } 33 focus-ring { 34 off 35 width 4 36 active-color "#7fc8ff" 37 inactive-color "#505050" 38 } 39 border { 40 width 4 41 active-color "#ffc87f" 42 inactive-color "#505050" 43 urgent-color "#9b0000" 44 active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue" 45 inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" 46 } 47 48 shadow { 49 on 50 // draw-behind-window true 51 softness 30 52 spread 5 53 offset x=0 y=5 54 color "#0007" 55 } 56 57 struts { 58 left 32 59 right 32 60 top 32 61 bottom 32 62 } 63} 64 65hotkey-overlay { 66 skip-at-startup 67} 68 69prefer-no-csd 70 71screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" 72 73animations { } 74 75// Work around WezTerm's initial configure bug 76// by setting an empty default-column-width. 77window-rule { 78 match app-id=r#"^org\.wezfurlong\.wezterm$"# 79 default-column-width {} 80} 81 82// Open the Firefox picture-in-picture player as floating by default. 83window-rule { 84 match app-id=r#"firefox$"# title="^Picture-in-Picture$" 85 open-floating true 86} 87 88binds { 89 Mod+Return hotkey-overlay-title="Open a Terminal" { spawn "app2unit" "xdg-terminal-exec"; } 90 Mod+B hotkey-overlay-title="Open Firefox" { spawn "app2unit" "firefox"; } 91 92 XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } 93 XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } 94 XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } 95 XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } 96 97 XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } 98 XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; } 99 XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } 100 XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } 101 102 XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } 103 XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } 104 105 Mod+Tab repeat=false { toggle-overview; } 106 107 Mod+Q repeat=false { close-window; } 108 109 Mod+Left { focus-column-left; } 110 Mod+Down { focus-window-down; } 111 Mod+Up { focus-window-up; } 112 Mod+Right { focus-column-right; } 113 114 Mod+Ctrl+Left { move-column-left; } 115 Mod+Ctrl+Down { move-window-down; } 116 Mod+Ctrl+Up { move-window-up; } 117 Mod+Ctrl+Right { move-column-right; } 118 119 Mod+Home { focus-column-first; } 120 Mod+End { focus-column-last; } 121 Mod+Ctrl+Home { move-column-to-first; } 122 Mod+Ctrl+End { move-column-to-last; } 123 124 Mod+Shift+Left { focus-monitor-left; } 125 Mod+Shift+Down { focus-monitor-down; } 126 Mod+Shift+Up { focus-monitor-up; } 127 Mod+Shift+Right { focus-monitor-right; } 128 129 Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } 130 Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } 131 Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } 132 Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } 133 134 Mod+Shift+P { move-workspace-to-monitor-left; } 135 136 Mod+Page_Down { focus-workspace-down; } 137 Mod+Page_Up { focus-workspace-up; } 138 Mod+Ctrl+Page_Down { move-column-to-workspace-down; } 139 Mod+Ctrl+Page_Up { move-column-to-workspace-up; } 140 141 Mod+Shift+Page_Down { move-workspace-down; } 142 Mod+Shift+Page_Up { move-workspace-up; } 143 Mod+Shift+U { move-workspace-down; } 144 Mod+Shift+I { move-workspace-up; } 145 146 Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } 147 Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } 148 Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } 149 Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } 150 151 Mod+WheelScrollRight { focus-column-right; } 152 Mod+WheelScrollLeft { focus-column-left; } 153 Mod+Ctrl+WheelScrollRight { move-column-right; } 154 Mod+Ctrl+WheelScrollLeft { move-column-left; } 155 156 Mod+Shift+WheelScrollDown { focus-column-right; } 157 Mod+Shift+WheelScrollUp { focus-column-left; } 158 Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } 159 Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } 160 161 Mod+1 { focus-workspace 1; } 162 Mod+2 { focus-workspace 2; } 163 Mod+3 { focus-workspace 3; } 164 Mod+4 { focus-workspace 4; } 165 Mod+5 { focus-workspace 5; } 166 Mod+6 { focus-workspace 6; } 167 Mod+7 { focus-workspace 7; } 168 Mod+8 { focus-workspace 8; } 169 Mod+9 { focus-workspace 9; } 170 Mod+Ctrl+1 { move-column-to-workspace 1; } 171 Mod+Ctrl+2 { move-column-to-workspace 2; } 172 Mod+Ctrl+3 { move-column-to-workspace 3; } 173 Mod+Ctrl+4 { move-column-to-workspace 4; } 174 Mod+Ctrl+5 { move-column-to-workspace 5; } 175 Mod+Ctrl+6 { move-column-to-workspace 6; } 176 Mod+Ctrl+7 { move-column-to-workspace 7; } 177 Mod+Ctrl+8 { move-column-to-workspace 8; } 178 Mod+Ctrl+9 { move-column-to-workspace 9; } 179 180 Mod+Comma { consume-or-expel-window-left; } 181 Mod+Period { consume-or-expel-window-right; } 182 183 184 Mod+R { switch-preset-column-width; } 185 Mod+Shift+R { switch-preset-window-height; } 186 Mod+Ctrl+R { reset-window-height; } 187 Mod+M { maximize-column; } 188 Mod+F { fullscreen-window; } 189 Mod+Ctrl+F { expand-column-to-available-width; } 190 Mod+C { center-column; } 191 Mod+Ctrl+C { center-visible-columns; } 192 193 Mod+T { toggle-window-floating; } 194 Mod+Shift+T { switch-focus-between-floating-and-tiling; } 195 196 Mod+W { toggle-column-tabbed-display; } 197 198 Print { screenshot; } 199 Ctrl+Print { screenshot-screen; } 200 Alt+Print { screenshot-window; } 201 202 // Applications such as remote-desktop clients and software KVM switches may 203 // request that niri stops processing the keyboard shortcuts defined here 204 // so they may, for example, forward the key presses as-is to a remote machine. 205 // It's a good idea to bind an escape hatch to toggle the inhibitor, 206 // so a buggy application can't hold your session hostage. 207 // 208 // The allow-inhibiting=false property can be applied to other binds as well, 209 // which ensures niri always processes them, even when an inhibitor is active. 210 Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } 211 212 // The quit action will show a confirmation dialog to avoid accidental exits. 213 Ctrl+Alt+Delete { quit; } 214} 215 216include optional=true "dms/colors.kdl" 217include optional=true "dms/cursor.kdl" 218include optional=true "dms/binds.kdl" 219include optional=true "dms/layout.kdl" 220include optional=true "dms/outputs.kdl" 221include optional=true "dms/wpblur.kdl"