Files
nix-config/home/linux/gui/niri/conf/windowrules.kdl
T

178 lines
5.0 KiB
KDL

// Window rules let you adjust behavior for individual windows.
// Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Window-Rules
// Draw the focus ring as an outline for every window, never as a solid
// rectangle behind it. Niri's default paints a `#7fc8ff` block behind the
// focused window, which shows through any semitransparent window (e.g. the
// terminals) as a solid cyan fill.
window-rule {
draw-border-with-background false
}
// Terminal applications - open in workspace 1
//
// Both emulators are configured identically (font, size, opacity, theme), so
// the focus ring colour is what names them: global cyan = ghostty, pink = kitty.
window-rule {
match app-id="kitty"
open-on-workspace "1terminal"
open-maximized true
focus-ring {
active-color "#f5c2e7" // catppuccin pink
}
}
window-rule {
match app-id="com.mitchellh.ghostty"
open-on-workspace "1terminal"
open-maximized true
}
// Web browsers - open in workspace 2
window-rule {
match app-id="firefox"
open-on-workspace "2browser"
open-maximized true
}
window-rule {
match app-id="google-chrome"
open-on-workspace "2browser"
open-maximized true
}
window-rule {
match app-id="chromium-browser"
open-on-workspace "2browser"
open-maximized true
}
// Chat applications - open in workspace 3
window-rule {
// match app-id="org.telegram.desktop"
match title="^Telegram"
open-on-workspace "3chat"
}
window-rule {
match app-id="wechat"
open-on-workspace "3chat"
}
window-rule {
match app-id="QQ"
open-on-workspace "3chat"
}
// Entertainment applications - open in workspace 4
window-rule {
// niri matches app-id anywhere in the string, so a bare "steam" would also
// catch the `steam_app_<GAMEID>` game windows below and hand them
// `open-maximized`, which fights their fullscreen rule. Anchor it so this
// only affects the Steam client window itself.
match app-id="^steam$"
open-on-workspace "4entertainment"
open-maximized true
}
window-rule {
match app-id="steam_app_default"
open-on-workspace "4entertainment"
}
window-rule {
// Games launched through umu/Proton -- including the launchers the
// nix-config-umu-game skill generates -- report `steam_app_<GAMEID>`.
// Without a rule Niri tiles them at the default 50% column width, and a
// DXGI "fullscreen" window larger than the output (a 4K panel here runs at
// scale 1.5, so Niri's logical space is 2560x1440) cannot take over the
// screen by itself.
//
// The launcher shares this app id with the game, so the rule also catches
// its own windows: a helper that is still untitled while it maps, and the
// announcement popup (公告), which on this launcher renders as a pure white
// rectangle. Fullscreening either one buries the UI that opened it, so
// both are excluded here.
match app-id="^steam_app_[0-9]+$"
exclude title="^$"
exclude title="^(公告|Announcement|Notice)$"
open-on-workspace "4entertainment"
open-fullscreen true
}
window-rule {
match app-id="heroic"
open-on-workspace "4entertainment"
}
window-rule {
// Run anime games on Linux
match app-id="^moe.launcher"
open-on-workspace "4entertainment"
}
window-rule {
// All *.exe (Windows applications)
match app-id=".exe$"
open-on-workspace "4entertainment"
}
window-rule {
match app-id="^mpv$"
open-on-workspace "4entertainment"
}
// Utility applications - open in workspace 5
window-rule {
match app-id="com.github.johnfactotum.Foliate"
open-on-workspace "5utility"
}
window-rule {
match app-id="thunar"
open-on-workspace "5utility"
}
window-rule {
match app-id="(?i)^clash-verge$"
match app-id="^[.]clash-verge-wrapped$"
open-on-workspace "5utility"
}
window-rule {
match app-id="^org[.]kde[.]easyeffects$"
open-on-workspace "5utility"
}
// Other applications - open in workspace 0
window-rule {
match app-id="BambuStudio"
open-on-workspace "0other"
}
window-rule {
match app-id="OrcaSlicer"
open-on-workspace "0other"
}
window-rule {
match app-id="Zoom Workplace"
// Zoom Home Page
match title="^(Zoom Workplace)( - Free account)?$"
open-on-workspace "0other"
}
window-rule {
match app-id="Zoom Workplace"
// Zoom - other windows
exclude title="^(Zoom Workplace)( - Free account)?$"
open-on-workspace "0other"
open-floating true
}
window-rule {
match app-id="^Zoom$"
open-on-workspace "0other"
}
window-rule {
match app-id="^Zoom$" title="^as_toolbar$"
open-floating true
default-floating-position x=0 y=16 relative-to="bottom"
}
window-rule {
match app-id="^Zoom$" title="^zoom_linux_float_video_window$"
open-fullscreen true
}
// Notifications shows bottom right
window-rule {
// match exactly empty string, avoid to be the default behavior
match app-id="^$"
open-floating true
open-focused false
default-floating-position x=0 y=0 relative-to="bottom-right"
}