# ######## Window rules ########

# Uncomment to apply global transparency to all windows:
# windowrulev2 = opacity 0.89 override 0.89 override, class:.*

# Disable blur for XWayland windows (or context menus with shadow would look weird)
windowrulev2 = noblur, xwayland:1

# Disable transparency
windowrulev2 = opacity 1 override 1 override, class:^(gimp)$

# Terminal(s)
windowrulev2 = float, class:^(com.mitchellh.ghostty)$
windowrulev2 = size 60%, class:^(com.mitchellh.ghostty)$
windowrulev2 = opacity 1 override 0.8 override, class:^(com.mitchellh.ghostty)$
windowrulev2 = opacity 1 override 0.8 override, class:^(kitty)$

# Floating
windowrulev2 = float, class:^(blueberry\.py)$
windowrulev2 = float, class:^(blueman-manager)$
windowrulev2 = size 45%, class:^(blueman-manager)$
windowrulev2 = float, class:^(pavucontrol)$
windowrulev2 = size 45%, class:^(pavucontrol)$
windowrulev2 = center, class:^(pavucontrol)$
windowrulev2 = float, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = size 45%, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = center, class:^(org.pulseaudio.pavucontrol)$
windowrulev2 = float, class:^(Waydroid)$
windowrulev2 = float, class:^(org.kde.kcalc)$
windowrulev2 = float, class:^(org.kde.kalk)$
windowrulev2 = float, class:^(org.gnome.NautilusPreviewer)$ # Sushi in Nautilus
windowrulev2 = float, class:^(coin)$
windowrulev2 = noblur, class:^(coin)$
windowrulev2 = bordersize 0, class:^(coin)$
windowrulev2 = noshadow, class:^(coin)
windowrulev2 = float, class:^(wallpaper-chooser)$
windowrulev2 = float, class:^(be.alexandervanhee.gradia)$
windowrulev2 = float, title:^(图片查看器)$ # QQ

# Picture-in-Picture
windowrulev2 = float, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = keepaspectratio, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = move 73% 72%, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = size 25%, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = float, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$
windowrulev2 = pin, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$

# Dialog windows – float+center these windows.
windowrulev2 = center, title:^(Open File)(.*)$
windowrulev2 = center, title:^(Select a File)(.*)$
windowrulev2 = center, title:^(Choose wallpaper)(.*)$
windowrulev2 = center, title:^(Open Folder)(.*)$
windowrulev2 = center, title:^(Save As)(.*)$
windowrulev2 = center, title:^(Library)(.*)$
windowrulev2 = center, title:^(File Upload)(.*)$
windowrulev2 = float, title:^(Open File)(.*)$
windowrulev2 = float, title:^(Select a File)(.*)$
windowrulev2 = float, title:^(Choose wallpaper)(.*)$
windowrulev2 = float, title:^(Open Folder)(.*)$
windowrulev2 = float, title:^(Save As)(.*)$
windowrulev2 = float, title:^(Library)(.*)$
windowrulev2 = float, title:^(File Upload)(.*)$


# --- Tearing ---
windowrulev2 = immediate, title:.*\.exe
windowrulev2 = immediate, class:^(steam_app)

# No shadow for tiled windows (matches windows that are not floating).
windowrulev2 = noshadow, floating:0

# ######## Workspace rules ########
workspace = special:special, gapsout:30

# ######## Layer rules ########
layerrule = xray 1, .*
# layerrule = noanim, .*
layerrule = noanim, walker
layerrule = noanim, selection
layerrule = noanim, overview
layerrule = noanim, anyrun
layerrule = noanim, indicator.*
layerrule = noanim, osk
layerrule = noanim, hyprpicker

layerrule = noanim, noanim
layerrule = blur, gtk-layer-shell
layerrule = ignorezero, gtk-layer-shell
layerrule = blur, launcher
layerrule = ignorealpha 0.5, launcher
layerrule = blur, notifications
layerrule = ignorealpha 0.69, notifications
layerrule = blur, logout_dialog # wlogout