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