From 469f7669b2002ea6378c311297fa5d4c90a02c1d Mon Sep 17 00:00:00 2001 From: Pavel Egorov Date: Tue, 9 Dec 2025 01:16:07 +0300 Subject: [niri] Set some window rules --- .config/niri/config.kdl | 41 +---------------------------------------- .config/niri/windows.kdl | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 .config/niri/windows.kdl (limited to '.config/niri') diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index 211f12d..af12bf8 100644 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -7,6 +7,7 @@ include "input.kdl" include "output.kdl" include "layout.kdl" include "binds.kdl" +include "windows.kdl" // Add lines like this to spawn processes at startup. @@ -51,46 +52,6 @@ animations { // slowdown 3.0 } -// Window rules let you adjust behavior for individual windows. -// Find more information on the wiki: -// https://yalter.github.io/niri/Configuration:-Window-Rules - -// Work around WezTerm's initial configure bug -// by setting an empty default-column-width. -window-rule { - // This regular expression is intentionally made as specific as possible, - // since this is the default config, and we want no false positives. - // You can get away with just app-id="wezterm" if you want. - match app-id=r#"^org\.wezfurlong\.wezterm$"# - default-column-width {} -} - -// 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 -} - -window-rule { - match app-id=r#"^org\.keepassxc\.KeePassXC$"# - - block-out-from "screen-capture" - - // Use this instead if you want them visible on third-party screenshot tools. - // block-out-from "screencast" -} - -// Example: enable rounded corners for all windows. -// (This example rule is commented out with a "/-" in front.) -window-rule { - geometry-corner-radius 12 - clip-to-geometry true -} - - cursor { xcursor-theme "breeze_cursors" } diff --git a/.config/niri/windows.kdl b/.config/niri/windows.kdl new file mode 100644 index 0000000..5f5b9d4 --- /dev/null +++ b/.config/niri/windows.kdl @@ -0,0 +1,41 @@ +// Window rules let you adjust behavior for individual windows. +// Find more information on the wiki: +// https://yalter.github.io/niri/Configuration:-Window-Rules + +window-rule { + geometry-corner-radius 12 + clip-to-geometry true +} + +// 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 + default-floating-position x=32 y=32 relative-to="bottom-right" +} + +window-rule { + match app-id=r#"^org\.keepassxc\.KeePassXC$"# + + block-out-from "screen-capture" +} + +window-rule { + match app-id=r#"^org\.telegram\.desktop$"# + exclude app-id=r#"^org\.telegram\.desktop$"# title="Media viewer" + + default-column-width { + fixed 900 + } +} + +window-rule { + match app-id=r#"^org\.telegram\.desktop$"# title="Media viewer" + + open-floating true +} + -- cgit v1.3