351 lines
14 KiB
KDL
351 lines
14 KiB
KDL
// Check the wiki for a full description of the configuration:
|
|
// https://niri-wm.github.io/niri/Configuration:-Introduction
|
|
|
|
spawn-at-startup "swaybg --image ./wallpapers/3_hypno_chimmie_firefly_videorelaxant6025.png"
|
|
|
|
input {
|
|
keyboard {
|
|
xkb {
|
|
// If this section is empty, niri will fetch xkb settings
|
|
// from org.freedesktop.locale1. You can control these using
|
|
// localectl set-x11-keymap.
|
|
}
|
|
numlock // Enable numlock on startup
|
|
}
|
|
|
|
touchpad {
|
|
tap
|
|
natural-scroll
|
|
// scroll-method "two-finger"
|
|
// disabled-on-external-mouse
|
|
}
|
|
|
|
mouse { }
|
|
trackpoint { }
|
|
}
|
|
|
|
gestures {
|
|
hot-corners {
|
|
off
|
|
}
|
|
}
|
|
|
|
// Settings that influence how windows are positioned and sized.
|
|
// Find more information on the wiki:
|
|
// https://niri-wm.github.io/niri/Configuration:-Layout
|
|
layout {
|
|
gaps 16
|
|
background-color "transparent"
|
|
|
|
// TODO: This view is pretty useless to me without titles on the tab bars, it's hard to tell wtf is in
|
|
// a stack
|
|
//default-column-display "tabbed"
|
|
|
|
// When to center a column when changing focus, options are:
|
|
// - "never", default behavior, focusing an off-screen column will keep at the left
|
|
// or right edge of the screen.
|
|
// - "always", the focused column will always be centered.
|
|
// - "on-overflow", focusing a column will center it if it doesn't fit
|
|
// together with the previously focused column.
|
|
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 also customize the heights that "switch-preset-window-height" (Mod+Ctrl+Shift+R) toggles between.
|
|
// preset-window-heights { }
|
|
|
|
// You can change the default width of the new windows.
|
|
default-column-width { proportion 0.5; }
|
|
// If you leave the brackets empty, the windows themselves will decide their initial width.
|
|
// default-column-width {}
|
|
|
|
// TODO: add prefer-no-csd to remove rounded corners and extra stuff from windows, but it removes Nemo's X button...
|
|
focus-ring {
|
|
width 3
|
|
active-color "#7fc8ff"
|
|
inactive-color "#505050"
|
|
}
|
|
|
|
tab-indicator {
|
|
// off
|
|
on
|
|
hide-when-single-tab
|
|
place-within-column
|
|
gap 5
|
|
width 10
|
|
length total-proportion=1.0
|
|
position "right"
|
|
gaps-between-tabs 2
|
|
corner-radius 0
|
|
active-color "red"
|
|
inactive-color "gray"
|
|
urgent-color "blue"
|
|
// active-gradient from="#80c8ff" to="#bbddff" angle=45
|
|
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
|
// urgent-gradient from="#800" to="#a33" angle=45
|
|
}
|
|
|
|
border { off; } // border
|
|
//shadow { } // Window shadows
|
|
//struts { } // Outer padding to windows
|
|
}
|
|
|
|
// Add lines like this to spawn processes at startup.
|
|
// Note that running niri as a session supports xdg-desktop-autostart,
|
|
// which may be more convenient to use.
|
|
// See the binds section below for more spawn examples.
|
|
|
|
// This line starts waybar, a commonly used bar for Wayland compositors.
|
|
|
|
|
|
// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup:
|
|
// spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell"
|
|
|
|
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.
|
|
// If the client will specifically ask for CSD, the request will be honored.
|
|
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
|
|
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
|
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
|
//prefer-no-csd
|
|
|
|
// You can change the path where screenshots are saved.
|
|
// A ~ at the front will be expanded to the home directory.
|
|
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
|
screenshot-path null //"~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
|
|
|
// You can also set this to null to disable saving screenshots to disk.
|
|
// screenshot-path null
|
|
|
|
animations { }
|
|
|
|
// Open the Firefox picture-in-picture player as floating by default.
|
|
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#"firefox$"# title="^Picture-in-Picture$"
|
|
open-floating true
|
|
}
|
|
|
|
// Example: block out two password managers from screen capture.
|
|
// (This example rule is commented out with a "/-" in front.)
|
|
/-window-rule {
|
|
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
|
match app-id=r#"^org\.gnome\.World\.Secrets$"#
|
|
|
|
block-out-from "screen-capture"
|
|
|
|
// Use this instead if you want them visible on third-party screenshot tools.
|
|
// block-out-from "screencast"
|
|
}
|
|
|
|
// slightly rounded corners for all windows
|
|
window-rule {
|
|
geometry-corner-radius 6
|
|
clip-to-geometry true
|
|
}
|
|
|
|
window-rule {
|
|
match app-id=r#"^com\.gabm\.satty$"#
|
|
open-floating true
|
|
min-width 730
|
|
min-height 300
|
|
}
|
|
|
|
binds {
|
|
Mod+Shift+Slash { show-hotkey-overlay; } // Mod+?
|
|
Mod+Shift+E { quit; }
|
|
Ctrl+Alt+Delete { quit; }
|
|
|
|
Mod+Shift+T hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; }
|
|
Mod+T { spawn "bash" "-c" "alacritty --working-directory $(ycwd $(niri msg --json focused-window | jq .pid))"; }
|
|
Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
|
|
Mod+E hotkey-overlay-title="Open file explorer" { spawn "nemo"; }
|
|
Mod+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; }
|
|
|
|
// Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc.
|
|
// Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`.
|
|
// For example, this is a standard bind to toggle the screen reader (orca).
|
|
// Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; }
|
|
|
|
// Example volume keys mappings for PipeWire & WirePlumber.
|
|
// The allow-when-locked=true property makes them work even when the session is locked.
|
|
// Using spawn-sh allows to pass multiple arguments together with the command.
|
|
// "-l 1.0" limits the volume to 100%.
|
|
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.
|
|
// You can use regular spawn with multiple arguments too (to avoid going through "sh"),
|
|
// but you need to manually put each argument in separate "" quotes.
|
|
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.
|
|
// You can also move the mouse into the top-left hot corner,
|
|
// or do a four-finger swipe up on a touchpad.
|
|
Mod+O repeat=false { toggle-overview; }
|
|
|
|
Mod+Q repeat=false { close-window; }
|
|
|
|
// 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"; }
|
|
|
|
// Print { screenshot; }
|
|
Ctrl+Print { screenshot-screen; }
|
|
Alt+Print { screenshot-window; }
|
|
|
|
Print { spawn-sh "set -e; grim -t ppm -g \"$(slurp -o -d -F monospace)\" - | satty --filename - --copy-command=wl-copy --annotation-size-factor 2.0 --output-filename=\"$(xdg-user-dir PICTURES)/Screenshots/Screenshotada from %Y-%m-%d %H:%M:%S.png\" --actions-on-enter=\"save-to-clipboard,exit\" --brush-smooth-history-size=5 --disable-notifications"; }
|
|
|
|
// 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.
|
|
Mod+Shift+P { power-off-monitors; }
|
|
|
|
|
|
// === Windows ===
|
|
Mod+V { toggle-window-floating; }
|
|
Mod+Shift+V { switch-focus-between-floating-and-tiling; }
|
|
|
|
Mod+M { maximize-window-to-edges; } // Same action as double clicking titlebar
|
|
Mod+C { center-column; } // Center on screen
|
|
Mod+Ctrl+C { center-visible-columns; } // Not quite sure what this one does
|
|
|
|
Mod+Ctrl+F { expand-column-to-available-width; } // Fill the rest if not already filled
|
|
// TODO: See TODO at top of layout
|
|
Mod+W { toggle-column-tabbed-display; }
|
|
|
|
// Movement
|
|
Mod+Left { focus-column-left; }
|
|
Mod+Down { focus-window-down; }
|
|
Mod+Up { focus-window-up; }
|
|
Mod+Right { focus-column-right; }
|
|
|
|
Mod+Ctrl+Left { move-column-left; }
|
|
Mod+Ctrl+Down { move-window-down; }
|
|
Mod+Ctrl+Up { move-window-up; }
|
|
Mod+Ctrl+Right { move-column-right; }
|
|
|
|
Mod+Home { focus-column-first; }
|
|
Mod+End { focus-column-last; }
|
|
Mod+Ctrl+Home { move-column-to-first; }
|
|
Mod+Ctrl+End { move-column-to-last; }
|
|
|
|
Mod+Shift+Left { focus-monitor-left; }
|
|
Mod+Shift+Down { focus-monitor-down; }
|
|
Mod+Shift+Up { focus-monitor-up; }
|
|
Mod+Shift+Right { focus-monitor-right; }
|
|
|
|
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
|
|
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
|
|
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
|
|
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
|
|
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
|
|
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
|
|
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
|
|
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
|
|
|
|
Mod+Page_Down { focus-workspace-down; }
|
|
Mod+Page_Up { focus-workspace-up; }
|
|
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
|
|
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
|
|
Mod+Shift+Page_Down { move-workspace-down; }
|
|
Mod+Shift+Page_Up { move-workspace-up; }
|
|
|
|
// Windows move into column left of right
|
|
Mod+BracketLeft { consume-or-expel-window-left; }
|
|
Mod+BracketRight { consume-or-expel-window-right; }
|
|
|
|
// You can bind mouse wheel scroll ticks using the following syntax.
|
|
// These binds will change direction based on the natural-scroll setting.
|
|
//
|
|
// To avoid scrolling through workspaces really fast, you can use
|
|
// the cooldown-ms property. The bind will be rate-limited to this value.
|
|
// You can set a cooldown on any bind, but it's most useful for the wheel.
|
|
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; }
|
|
|
|
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; }
|
|
|
|
// Resizing
|
|
Mod+R { switch-preset-column-width; }
|
|
Mod+Shift+R { switch-preset-column-width-back; }
|
|
Mod+Ctrl+Shift+R { switch-preset-window-height; }
|
|
Mod+Ctrl+R { reset-window-height; }
|
|
|
|
// Finer adjustments
|
|
Mod+Minus { set-column-width "-10%"; }
|
|
Mod+Equal { set-column-width "+10%"; }
|
|
Mod+Shift+Minus { set-window-height "-10%"; }
|
|
Mod+Shift+Equal { set-window-height "+10%"; }
|
|
}
|