Vic's *Nix config.

niri

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