// 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$"

    // Floating windows for LXQt:
    match app-id=r#"^lxqt-.*|pavu.*|.*copyq|qarma|.*portal-lxqt.*|.*conf$"#
    // You may need to localize some of those:
    match title=r#"^Preferen.*|.*file.*|Password.*|Prop.*|Close.*|Select.*$"#
    exclude app-id="lxqt-archiver"
    open-floating true
}

    // Use wallpaper set with swaybg for the overview background
layer-rule {
    match namespace="^wallpaper$"
    place-within-backdrop 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"
}

// enable rounded corners for all windows.
window-rule {
    geometry-corner-radius 8
    clip-to-geometry true
}
