You can set window rules to achieve different behaviours from the active container.
RULEis a rule (and a param if applicable)
WINDOWis a RegEx, either:
- plain RegEx (for matching a window class);
title:followed by a regex (for matching a window’s title)
windowrule=float,^(kitty)$ windowrule=move 0 0,title:^(Firefox)(.*)$
In order to allow more flexible rules, while retaining compatibility with the above rule system, window rules V2 were implemented.
In V2, you are allowed to match multiple variables.
RULE field is unchanged, but in the
WINDOW field, you can put regexes
for multiple values like so:
windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
For now, the supported fields are:
class - class regex title - title regex xwayland - 0/1 floating - 0/1 fullscreen - 0/1 pinned - 0/1
Keep in mind that you have to declare at least one field, but not all.
To get more information about a window’s class, title, XWayland status or its size, you can use
|float||floats a window|
|tile||tiles a window|
|fullscreen||fullscreens a window|
|maximize||maximizes a window|
|nofullscreenrequest||prevents windows from requesting fullscreen mode, you can still manually toggle fullscreen.|
|move [x] [y]||moves a floating window (x,y -> int or %, e.g. 20% or 100. You are also allowed to do |
|size [x] [y]||resizes a floating window (x,y -> int or %, e.g. 20% or 100)|
|minsize [x] [y]||sets the minimum size on creation (x,y -> int)|
|maxsize [x] [y]||sets the maximum size on creation (x,y -> int)|
|center||if the window is floating, will center it on the monitor|
|pseudo||pseudotiles a window|
|monitor [id]||sets the monitor on which a window should open|
|workspace [w]||sets the workspace on which a window should open (for workspace syntax, see dispatchers->workspaces). You can also make [w] to |
|opacity [a]||additional opacity multiplier. Options for a: ||✓|
|opaque||forces the window to be opaque (can be toggled with the toggleopaque dispatcher)||✓|
|animation [style] ([opt])||forces an animation onto a window, with a selected opt. Opt is optional.||✓|
|rounding [x]||forces the application to have X pixels of rounding, ignoring the set default (in ||✓|
|noblur||disables blur for the window||✓|
|nofocus||disables focus to the window|
|noborder||disables borders for the window||✓|
|noshadow||disables shadows for the window||✓|
|forceinput||forces an XWayland window to receive input, even if it requests not to do so. (Might fix issues like e.g. Game Launchers not receiving focus for some reason)|
|windowdance||forces an XWayland window to never refocus, used for games/applications like Rhythm Doctor|
|pin||pins the window note: floating only|
|noanim||disables the animations for the window||✓|
|bordercolor [c]||force the bordercolor of the window. Options for c: ||✓|
|idleinhibit [mode]||sets an idle inhibit rule for the window. If active, apps like |
|unset||removes all previously set rules for the given parameters. Please note it has to match EXACTLY.|
|nomaxsize||removes max size limitations. Especially useful with windows that report invalid max sizes (e.g. winecfg)|
|dimaround||dims everything around the window . Please note this rule is meant for floating windows and using it on tiled ones may result in strange behavior.||✓|
windowrule = move 100 100,^(kitty)$ # moves kitty to 100 100 windowrule = animation popin,^(kitty)$ # sets the animation style for kitty windowrule = noblur,^(firefox)$ # disables blur for firefox windowrule = move cursor -50% -50%,^(kitty)$ # moves kitty to the center of the cursor windowrulev2 = bordercolor rgb(FF0000) rgb(880808),fullscreen:1 # set bordercolor to red if window is fullscreen windowrulev2 = bordercolor rgb(FFFF00),title:^(.*Hyprland.*)$ # set bordercolor to yellow when title contains Hyprland windowrule = opacity 1.0 override 0.5 override,^(kitty)$ # set opacity to 1.0 active and 0.5 inactive for kitty windowrule = rounding 10,^(kitty)$ # set rounding to 10 for kitty
Rules that are marked as Dynamic will be reevaluated if the matching property of the window changes. For instance, if a rule is defined that changes the bordercolor of a window when it is floating, then the bordercolor will change to the requested color when it is set to floating, and revert to the default color when it is tiled again. Dynamic matching properties are title, floating, fullscreen and pinned.
Rules will be processed from top to bottom, where the last match will take precedence. i.e.
windowrulev2 = opacity 0.8 0.8,class:^(kitty)$ windowrulev2 = opacity 0.5 0.5,floating:1
-> all kitty windows will have opacity 0.8, except if they are floating. Then they will have opacity 0.5. -> all floating windows will have opacity 0.5.
windowrulev2 = opacity 0.5 0.5,floating:1 windowrulev2 = opacity 0.8 0.8,class:^(kitty)$
-> all kitty windows will have opacity 0.8, also if they are floating. -> all other floating windows will have opacity 0.5.
Opacity is always a PRODUCT of all opacities. E.g.
active_opacityto 0.5 and windowrule opacity to 0.5 will result in a total opacity 0.25. You are allowed to set opacities over 1, but any opacity product over 1 will cause graphical glitches. E.g.
0.5 * 2 = 1, and it will be fine,
0.5 * 4will cause graphical glitches.
Some things in wayland are not windows, but layers. That includes for example most launchers, your status bar or wallpaper.
Those have specific rules separate from windows:
layerrule = rule, namespace
rule is the rule and
namespace is the namespace regex (find namespaces in