// This config is in the KDL format: https://kdl.dev // "/-" comments out the following node. // Check the wiki for a full description of the configuration: // https://yalter.github.io/niri/Configuration:-Introduction include "monitors.kdl" // Input device configuration. // Find the full list of options on the wiki: // https://yalter.github.io/niri/Configuration:-Input input { keyboard { xkb { } // Enable numlock on startup, omitting this setting disables it. numlock } touchpad { // off tap // dwt // dwtp // drag false // drag-lock natural-scroll // accel-speed 0.2 // accel-profile "flat" // scroll-method "two-finger" // disabled-on-external-mouse } mouse { // off // natural-scroll // accel-speed 0.2 // accel-profile "flat" // scroll-method "no-scroll" } trackpoint { // off // natural-scroll // accel-speed 0.2 // accel-profile "flat" // scroll-method "on-button-down" // scroll-button 273 // scroll-button-lock // middle-emulation } // Uncomment this to make the mouse warp to the center of newly focused windows. // warp-mouse-to-focus // Focus windows and outputs automatically when moving the mouse into them. // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. focus-follows-mouse max-scroll-amount="0%" } // Adding this in case it helps for Java programs environment { DISPLAY ":1" // # Optional: You may also need to add the following for some specific issues _JAVA_AWT_WM_NONREPARENTING "1" // GLFW_PLATFORM "x11" } // Hide cursor when typing; also hides cursor from screenshots! cursor { hide-when-typing } // Turning off the 'toggle-overview' when cursor is in the corner. gestures { hot-corners { off // Disables only the top-left corner } } // Settings that influence how windows are positioned and sized. // Find more information on the wiki: // https://yalter.github.io/niri/Configuration:-Layout layout { gaps 14 center-focused-column "never" // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between. preset-column-widths { // Proportion sets the width as a fraction of the output width, taking gaps into account. // For example, you can perfectly fit four windows sized "proportion 0.25" on an output. // The default preset widths are 1/3, 1/2 and 2/3 of the output. proportion 0.33333 proportion 0.5 proportion 0.66667 // Fixed sets the width in logical pixels exactly. // fixed 1920 } // You can change the default width of the new windows. default-column-width { proportion 0.5; } // You can change how the focus ring looks. focus-ring { width 3 active-color "#7fc8ff" inactive-color "#282c34" // You can also use gradients. They take precedence over solid colors. // active-gradient from="#80c8ff" to="#c7ff7f" angle=45 // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" } // You can also add a border. It's similar to the focus ring, but always visible. border { // The settings are the same as for the focus ring. // If you enable the border, you probably want to disable the focus ring. off } // You can enable drop shadows for windows. shadow { on softness 30 spread 5 offset x=0 y=5 color "#0007" } // Struts shrink the area occupied by windows, similarly to layer-shell panels. // You can think of them as a kind of outer gaps. They are set in logical pixels. // Left and right struts will cause the next window to the side to always be visible. // Top and bottom struts will simply add outer gaps in addition to the area occupied by // layer-shell panels and regular gaps. struts { // left 64 // right 64 // top 64 // bottom 64 } } // Add lines like this to spawn processes at startup. spawn-at-startup "swayidle" "-w" \ "timeout" "600" "niri msg action power-off-monitors" //spawn-at-startup "xwayland-satellite" spawn-at-startup "waypaper" "--backend" "swaybg" "--restore" spawn-sh-at-startup "dms run" spawn-at-startup "/usr/bin/emacs" "--daemon" spawn-at-startup "nextcloud" hotkey-overlay { // Uncomment this line to disable the "Important Hotkeys" pop-up at startup. skip-at-startup } // Uncomment this line to ask the clients to omit their client-side decorations if possible. prefer-no-csd // You can change the path where screenshots are saved. screenshot-path "~/Screenshots/scrot-%Y-%m-%d %H-%M-%S.png" // Animation settings. // The wiki explains how to configure individual animations: // https://yalter.github.io/niri/Configuration:-Animations animations { // Uncomment to turn off all animations. // off // Slow down all animations by this factor. Values below 1 speed them up instead. // slowdown 3.0 } // Window rules let you adjust behavior for individual windows. window-rule { match title="VirtualBox" open-fullscreen true } window-rule { // This app-id regular expression will work for both: // - host Firefox (app-id is "firefox") // - Flatpak Firefox (app-id is "org.mozilla.firefox") match app-id=r#"audacity$"# match app-id=r#"brave-browser$"# match app-id=r#"discord$"# match app-id=r#"gimp$"# match app-id=r#"kdenlive$"# match app-id=r#"qutebrowser$"# match app-id=r#"tasty.javafx.launcher.LauncherFxApp$"# title="^dt.*" match app-id=r#"tasty.javafx.launcher.LauncherFxApp$"# title="^tastytrade v.*" match app-id=r#"tastytrade$"# open-maximized true } window-rule { // This app-id regular expression will work for both: // - host Firefox (app-id is "firefox") // - Flatpak Firefox (app-id is "org.mozilla.firefox") match app-id=r#"qalculate-gtk$"# match app-id=r#"tasty.javafx.launcher.LauncherFxApp$"# title="Dashboard" match app-id=r#"tasty.javafx.launcher.LauncherFxApp$"# title="tastytrade - Portfolio Report" match app-id=r#"tastytrade$"# title="tastytrade - capital requirements" open-floating true } // Example: enable rounded corners for all windows. window-rule { geometry-corner-radius 6 clip-to-geometry true } binds { Mod+Shift+Slash hotkey-overlay-title="Show important bindings" { show-hotkey-overlay; } // Mod+Shift+Return hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel" "-f" "Ubuntu:weight=regular:size=12" "-w" "60" "-x" "14" "-y" "14" "-b" "#282c34ff" "-t" "#abb2bfff" "-m" "#51afefff" "-s" "#1c1f24ff" "-S" "#abb2bfff" "-M" "#51afefff" "-C" "#51afefff" "-p" "RUN:"; } Mod+Return hotkey-overlay-title="Open terminal: alacritty" { spawn "alacritty"; } Mod+Shift+Return hotkey-overlay-title="Run launcher: rofi" { spawn "rofi" "-show" "drun" "-show-icons"; } Mod+Alt+Minus hotkey-overlay-title="Lock screen: swaylock" { spawn "swaylock"; } Mod+E hotkey-overlay-title="Open emacs" { spawn "emacsclient" "-c" "-a" "emacs"; } Mod+W hotkey-overlay-title="Open browser: brave" { spawn "brave"; } Mod+Shift+P hotkey-overlay-title="Password menu" { spawn "rofi-pass-wl"; } Mod+Shift+Q hotkey-overlay-title="Quit out of niri" { quit; } // Example volume keys mappings for PipeWire & WirePlumber. XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } // Example media keys mapping using playerctl. // This will work with any MPRIS-enabled media player. XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; } XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } // Example brightness key mappings for brightnessctl. XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } // Open/close the Overview: a zoomed-out view of workspaces and windows. Mod+O repeat=false hotkey-overlay-title="Toggle overview" { toggle-overview; } // Close window with focus Mod+Shift+C repeat=false hotkey-overlay-title="Close window" { close-window; } // Move focus right, down, up, left Mod+H hotkey-overlay-title="Focus column left" { focus-column-left; } Mod+J hotkey-overlay-title="Focus window/workspace down" { focus-window-or-workspace-down; } Mod+K hotkey-overlay-title="Focus window/workspace up" { focus-window-or-workspace-up; } Mod+L hotkey-overlay-title="Focus column right"{ focus-column-right; } // Move columns right, down, up, left Mod+Shift+H { move-column-left-or-to-monitor-left; } Mod+Shift+J { move-column-to-workspace-down; } Mod+Shift+K { move-column-to-workspace-up; } Mod+Shift+L { move-column-right-or-to-monitor-right; } // These are useful moving windows up/down in tabbed columns. // Using arrow keys because I'm running out of HJKL keybinds. Mod+Shift+Down { move-window-down; } Mod+Shift+Up { move-window-up; } // Alternative commands that move across workspaces when reaching // the first or last window in a column. // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } Mod+Home { focus-column-first; } Mod+End { focus-column-last; } Mod+Ctrl+Home { move-column-to-first; } Mod+Ctrl+End { move-column-to-last; } // Switch focus of multiple monitors Mod+Comma { focus-monitor-previous; } Mod+Period { focus-monitor-next; } // Not sure what these even do, so I'm keeping them. Mod+Ctrl+U { move-workspace-down; } Mod+Ctrl+I { move-workspace-up; } // You can bind mouse wheel scroll ticks using the following syntax. Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } Mod+WheelScrollRight { focus-column-right; } Mod+WheelScrollLeft { focus-column-left; } Mod+Ctrl+WheelScrollRight { move-column-right; } Mod+Ctrl+WheelScrollLeft { move-column-left; } // Usually scrolling up and down with Shift in applications results in // horizontal scrolling; these binds replicate that. Mod+Shift+WheelScrollDown { focus-column-right; } Mod+Shift+WheelScrollUp { focus-column-left; } Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } // You can refer to workspaces by index. However, keep in mind that // niri is a dynamic workspace system, so these commands are kind of // "best effort". Trying to refer to a workspace index bigger than // the current workspace count will instead refer to the bottommost // (empty) workspace. Mod+1 { focus-workspace 1; } Mod+2 { focus-workspace 2; } Mod+3 { focus-workspace 3; } Mod+4 { focus-workspace 4; } Mod+5 { focus-workspace 5; } Mod+6 { focus-workspace 6; } Mod+7 { focus-workspace 7; } Mod+8 { focus-workspace 8; } Mod+9 { focus-workspace 9; } Mod+Ctrl+1 { move-column-to-workspace 1; } Mod+Ctrl+2 { move-column-to-workspace 2; } Mod+Ctrl+3 { move-column-to-workspace 3; } Mod+Ctrl+4 { move-column-to-workspace 4; } Mod+Ctrl+5 { move-column-to-workspace 5; } Mod+Ctrl+6 { move-column-to-workspace 6; } Mod+Ctrl+7 { move-column-to-workspace 7; } Mod+Ctrl+8 { move-column-to-workspace 8; } Mod+Ctrl+9 { move-column-to-workspace 9; } // Alternatively, there are commands to move just a single window: // Mod+Ctrl+1 { move-window-to-workspace 1; } // Switches focus between the current and the previous workspace. // Mod+Tab { focus-workspace-previous; } // The following binds move the focused window in and out of a column. // If the window is alone, they will consume it into the nearby column to the side. // If the window is already in a column, they will expel it out. Mod+Alt+H { consume-or-expel-window-left; } Mod+Alt+L { consume-or-expel-window-right; } // Consume one window from the right to the bottom of the focused column. Mod+BracketLeft { consume-window-into-column; } // Expel the bottom window from the focused column to the right. Mod+BracketRight { expel-window-from-column; } Mod+R { switch-preset-column-width; } // Cycling through the presets in reverse order is also possible. // Mod+R { switch-preset-column-width-back; } Mod+Shift+R { switch-preset-window-height; } Mod+Ctrl+R { reset-window-height; } // Fullscreen Mod+F { maximize-column; } Mod+Shift+F { fullscreen-window; } // Floating Mod+V { toggle-window-floating; } Mod+Shift+V { switch-focus-between-floating-and-tiling; } // Expand the focused column to space not taken up by other fully visible columns. // Makes the column "fill the rest of the space". Mod+Ctrl+F { expand-column-to-available-width; } // Center columns Mod+C { center-column; } Mod+Ctrl+C { center-visible-columns; } // Finer width adjustments. Mod+Minus { set-column-width "-10%"; } Mod+Equal { set-column-width "+10%"; } // Finer height adjustments when in column with other windows. Mod+Shift+Minus { set-window-height "-10%"; } Mod+Shift+Equal { set-window-height "+10%"; } // Toggle tabbed column display mode. // Windows in this column will appear as vertical tabs, // rather than stacked on top of each other. Mod+T hotkey-overlay-title="Toggle tabbed display" { toggle-column-tabbed-display; } // Actions to switch layouts. // Note: if you uncomment these, make sure you do NOT have // a matching layout switch hotkey configured in xkb options above. // Having both at once on the same hotkey will break the switching, // since it will switch twice upon pressing the hotkey (once by xkb, once by niri). // Mod+Space { switch-layout "next"; } // Mod+Shift+Space { switch-layout "prev"; } Mod+apostrophe { screenshot-screen; } Mod+Alt+apostrophe { screenshot-window; } Mod+Shift+apostrophe { screenshot; } // Applications such as remote-desktop clients and software KVM switches may // request that niri stops processing the keyboard shortcuts defined here // so they may, for example, forward the key presses as-is to a remote machine. // It's a good idea to bind an escape hatch to toggle the inhibitor, // so a buggy application can't hold your session hostage. // // The allow-inhibiting=false property can be applied to other binds as well, // which ensures niri always processes them, even when an inhibitor is active. Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } // Powers off the monitors. To turn them back on, do any input like // moving the mouse or pressing any other key. Ctrl+Alt+P { power-off-monitors; } } include "dms/cursor.kdl" include "dms/windowrules.kdl"