examples: niri: Update and reorder configurations.

This commit is contained in:
Hilton Chain 2026-02-15 15:09:13 +08:00
parent 9e52e49acb
commit 5d1948fc96
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292

View File

@ -266,12 +266,10 @@ layout {
} }
// Add lines like this to spawn processes at startup. // 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. // See the binds section below for more spawn examples.
// This line starts waybar, a commonly used bar for Wayland compositors. // Start user Shepherd for Guix Home.
// spawn-at-startup "waybar" spawn-at-startup "shepherd"
// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup: // To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup:
// spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell" // spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell"
@ -286,7 +284,7 @@ hotkey-overlay {
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. // 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. // 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. // After enabling or disabling this, you need to restart the apps for this to take effect.
// prefer-no-csd prefer-no-csd
// You can change the path where screenshots are saved. // You can change the path where screenshots are saved.
// A ~ at the front will be expanded to the home directory. // A ~ at the front will be expanded to the home directory.
@ -311,14 +309,13 @@ animations {
// Find more information on the wiki: // Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Window-Rules // https://yalter.github.io/niri/Configuration:-Window-Rules
// Work around WezTerm's initial configure bug // Keep WezTerm maximized so that the installer won't be resized.
// by setting an empty default-column-width.
window-rule { window-rule {
// This regular expression is intentionally made as specific as possible, // This regular expression is intentionally made as specific as possible,
// since this is the default config, and we want no false positives. // since this is the default config, and we want no false positives.
// You can get away with just app-id="wezterm" if you want. // You can get away with just app-id="wezterm" if you want.
match app-id=r#"^org\.wezfurlong\.wezterm$"# match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {} open-maximized true
} }
// Open the Firefox picture-in-picture player as floating by default. // Open the Firefox picture-in-picture player as floating by default.
@ -329,6 +326,10 @@ window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$" match app-id=r#"firefox$"# title="^Picture-in-Picture$"
open-floating true open-floating true
} }
window-rule {
match app-id=r#"librewolf$"# title="^Picture-in-Picture$"
open-floating true
}
// Example: block out two password managers from screen capture. // Example: block out two password managers from screen capture.
// (This example rule is commented out with a "/-" in front.) // (This example rule is commented out with a "/-" in front.)
@ -342,13 +343,22 @@ window-rule {
// block-out-from "screencast" // block-out-from "screencast"
} }
// Example: enable rounded corners for all windows. // Enable rounded corners for all windows.
// (This example rule is commented out with a "/-" in front.) // For Noctalia shell.
/-window-rule { window-rule {
geometry-corner-radius 12 geometry-corner-radius 20
clip-to-geometry true clip-to-geometry true
} }
debug {
honor-xdg-activation-with-invalid-serial
}
// Background color to match the wallpaper.
overview {
backdrop-color "#D2DEE9"
}
binds { binds {
// Keys consist of modifiers separated by + signs, followed by an XKB key name // Keys consist of modifiers separated by + signs, followed by an XKB key name
// in the end. To find an XKB name for a particular key, you may use a program // in the end. To find an XKB name for a particular key, you may use a program
@ -623,31 +633,3 @@ binds {
// moving the mouse or pressing any other key. // moving the mouse or pressing any other key.
Mod+Shift+P { power-off-monitors; } Mod+Shift+P { power-off-monitors; }
} }
// Start user Shepherd.
spawn-at-startup "shepherd"
// Noctalia shell.
window-rule {
geometry-corner-radius 20
clip-to-geometry true
}
debug {
honor-xdg-activation-with-invalid-serial
}
// Emacs has a window height > 100% whening using CSD.
prefer-no-csd
// Keep WezTerm maximized so that the installer won't be resized.
window-rule {
match app-id="org.wezfurlong.wezterm"
open-maximized true
}
// Background color to match the wallpaper.
overview {
backdrop-color "#D2DEE9"
}