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

# Global transparency (uncomment to apply to all windows)
@GLOBAL_TRANSPARENCY@

# Disable blur for xwayland context menus
windowrulev2 = noblur,class:^()$,title:^()$

# Floating windows
windowrulev2 = float, class:^(blueberry\.py)$
windowrulev2 = float, class:^(guifetch)$   # FlafyDev/guifetch
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:^(nm-connection-editor)$
windowrulev2 = size 45%, class:^(nm-connection-editor)$
windowrulev2 = center, class:^(nm-connection-editor)$
windowrulev2 = float, class:.*plasmawindowed.*
windowrulev2 = float, class:kcm_.*
windowrulev2 = float, class:.*bluedevilwizard
windowrulev2 = float, title:.*Welcome
windowrulev2 = float, title:^(illogical-impulse Settings)$
windowrulev2 = float, class:org.freedesktop.impl.portal.desktop.kde
windowrulev2 = float, class:^(Zotero)$
windowrulev2 = size 45%, class:^(Zotero)$

# Special positioning
# kde-material-you-colors spawns a window when changing dark/light theme
windowrulev2 = float, class:^(plasma-changeicons)$
windowrulev2 = noinitialfocus, class:^(plasma-changeicons)$
windowrulev2 = move 999999 999999, class:^(plasma-changeicons)$
# Dolphin copy dialog
windowrulev2 = move 40 80, title:^(Copying — Dolphin)$

# Force tiling for specific apps
windowrulev2 = tile, class:^dev\.warp\.Warp$

# 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 = 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 = center, title:^(.*)(wants to save)$
windowrulev2 = center, title:^(.*)(wants to open)$
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)(.*)$
windowrulev2 = float, title:^(.*)(wants to save)$
windowrulev2 = float, title:^(.*)(wants to open)$

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

# No shadow for tiled windows
windowrulev2 = noshadow, floating:0

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

# ######## Layer rules ########
layerrule = xray 1, .*

# No animations for specific layers
layerrule = noanim, walker
layerrule = noanim, selection
layerrule = noanim, overview
layerrule = noanim, anyrun
layerrule = noanim, indicator.*
layerrule = noanim, osk
layerrule = noanim, hyprpicker
layerrule = noanim, noanim

# GTK layer shell
layerrule = blur, gtk-layer-shell
layerrule = ignorezero, gtk-layer-shell

# Launcher
layerrule = blur, launcher
layerrule = ignorealpha 0.5, launcher

# Notifications
layerrule = blur, notifications
layerrule = ignorealpha 0.69, notifications

# Logout dialog
layerrule = blur, logout_dialog # wlogout

# AGS layers
layerrule = animation slide left, sideleft.*
layerrule = animation slide right, sideright.*
layerrule = blur, session[0-9]*
layerrule = blur, bar[0-9]*
layerrule = ignorealpha 0.6, bar[0-9]*
layerrule = blur, barcorner.*
layerrule = ignorealpha 0.6, barcorner.*
layerrule = blur, dock[0-9]*
layerrule = ignorealpha 0.6, dock[0-9]*
layerrule = blur, indicator.*
layerrule = ignorealpha 0.6, indicator.*
layerrule = blur, overview[0-9]*
layerrule = ignorealpha 0.6, overview[0-9]*
layerrule = blur, cheatsheet[0-9]*
layerrule = ignorealpha 0.6, cheatsheet[0-9]*
layerrule = blur, sideright[0-9]*
layerrule = ignorealpha 0.6, sideright[0-9]*
layerrule = blur, sideleft[0-9]*
layerrule = ignorealpha 0.6, sideleft[0-9]*
layerrule = blur, osk[0-9]*
layerrule = ignorealpha 0.6, osk[0-9]*

# Quickshell layers
layerrule = blurpopups, quickshell:.*
layerrule = blur, quickshell:.*
layerrule = ignorealpha 0.79, quickshell:.*
layerrule = animation slide top, quickshell:bar
layerrule = animation fade, quickshell:screenCorners
layerrule = animation slide right, quickshell:sidebarRight
layerrule = animation slide left, quickshell:sidebarLeft
layerrule = animation slide bottom, quickshell:osk
layerrule = animation slide bottom, quickshell:dock
layerrule = blur, quickshell:session
layerrule = noanim, quickshell:session
layerrule = ignorealpha 0, quickshell:session
layerrule = animation fade, quickshell:notificationPopup
layerrule = blur, quickshell:backgroundWidgets
layerrule = ignorealpha 0.05, quickshell:backgroundWidgets
layerrule = noanim, quickshell:screenshot
layerrule = animation popin 120%, quickshell:screenCorners
layerrule = noanim, quickshell:lockWindowPusher

# Launchers need to be FAST
layerrule = noanim, quickshell:overview
layerrule = noanim, gtk4-layer-shell

# Outfoxxed's shell layers
layerrule = blur, shell:bar
layerrule = ignorezero, shell:bar
layerrule = blur, shell:notifications
layerrule = ignorealpha 0.1, shell:notifications

# Custom window rules
@CUSTOM_WINDOW_RULES@
