

# Default floating rules to stop windows being too large or small
windowrule {
  name = default-floating-size-limit
  max_size = (monitor_w*0.8) (monitor_h*0.8)
  match:float = 1
}

windowrule {
  name = kdenlive-floating-size
  min_size = (monitor_w*0.5) (monitor_h*0.75)
  match:class = (^org.kde.kdenlive$)
}

windowrule {
  name = xdg-desktop-portal-gtk-floating
  float = on
  max_size = (monitor_w*0.8) (monitor_h*0.8)
  opacity = 1 override 1 override
  stay_focused = on
  match:class = (^xdg-desktop-portal-gtk$)
}

windowrule {
  name = floating-windowrule-1
  float = on
  max_size = (monitor_w*0.8) (monitor_h*0.8)
  center = on
  match:class = (float)
}

windowrule {
  name = floating-windowrule-2
  float = on
  size = (monitor_w*0.8) (monitor_h*0.8)
  center = on
  match:class = (float-80)
}


windowrule {
  name = swayimg-floating
  float = on
  size = (monitor_w*0.8)
  match:class = (swayimg)
}

windowrule {
  name = null-class-windowrule
  no_blur = 1 noanim 1 noshadow 1
  match:class = (^$)
}

windowrule {
  name = null-title-windowrule
  no_blur = 1 noanim 0 noshadow 1
  no_focus = 1
  match:title = (^$)
}

windowrule {
  name = mpv-floating
  float = on
  match:class = (mpv)
}

windowrule {
  name = brave-floating
  float = on
  move = 
  match:class = ^(brave-)(.*)(-.*)$
}


windowrule {
  name = nextcloud-floating
  move = (monitor_w-window_w) 45
  float = on
  size = 800 800
  match:class = ^(com.nextcloud.desktopclient.nextcloud)$
}


windowrule {
  name = soffice-focused
  stay_focused = on
  match:class = ^(soffice)$
}

windowrule {
  name = virt-manager-focused
  stay_focused = on
  match:class = ^(virt-manager)$
  match:title = ^$
}

windowrule {
  name = sparrow-wallet-focused
  opacity = 1 override 1 override
  stay_focused = on
  match:class = ^(Sparrow)$
  match:title = ^$
}

# No Opacity windowrules
windowrule {
  name = brave-browser-opacity
  opacity = 1 override 1 override
  match:class = ^(brave-browser)$
}

windowrule {
  name = mpv-opacity
  opacity = 1 override 1 override
  match:class = ^(mpv)$
}

windowrule {
  name = virt-manager-opacity
  opacity = 1 override 1 override
  match:class = ^(virt-manager)$
}

windowrule {
  name = bootstrap-studio-opacity
  opacity = 1 override 1 override
  match:class = ^(Bootstrap Studio)$
}

windowrule {
  name = minecraft-opacity
  opacity = 1 override 1 override
  match:class = ^(Minecraft)(.*)$
}

windowrule {
  name = gimp-opacity
  opacity = 1 override 1 override
  match:class = ^(gimp)$
}

windowrule {
  name = com-obsproject-Studio-opacity
  opacity = 1 override 1 override
  match:class = ^(com.obsproject.Studio)$
}

windowrule {
  name = empty-class-opacity
  opacity = 1 override 1 override
  match:class = ^$
}

# Disable opacity for Alacritty (as it already has a transparent background)
windowrule {
  name = alacritty-opacity
  opacity = 1 override 0.75 override
  match:class = ^(Alacritty)$
}


workspace = special:terminal, on-created-empty: alacritty

# Tags for opacity
windowrule {
  name = tag-opacity-0.1
  opacity = 0.1 override 0.1 override
  match:tag = opacity:0.1
}

windowrule {
  name = tag-opacity-0.2
  opacity = 0.2 override 0.2 override
  match:tag = opacity:0.2
}

windowrule {
  name = tag-opacity-0.3
  opacity = 0.3 override 0.3 override
  match:tag = opacity:0.3
}

windowrule {
  name = tag-opacity-0.4
  opacity = 0.4 override 0.4 override
  match:tag = opacity:0.4
}

windowrule {
  name = tag-opacity-0.5
  opacity = 0.5 override 0.5 override
  match:tag = opacity:0.5
}

windowrule {
  name = tag-opacity-0.6
  opacity = 0.6 override 0.6 override
  match:tag = opacity:0.6
}

windowrule {
  name = tag-opacity-0.7
  opacity = 0.7 override 0.7 override
  match:tag = opacity:0.7
}

windowrule {
  name = tag-opacity-0.8
  opacity = 0.8 override 0.8 override
  match:tag = opacity:0.8
}

windowrule {
  name = tag-opacity-0.9
  opacity = 0.9 override 0.9 override
  match:tag = opacity:0.9
}

windowrule {
  name = tag-opacity-1
  opacity = 1 override 1 override
  match:tag = opacity:1
}

windowrule {
  name = xfreerdp-floating
  float = on
  match:class = ^(xfreerdp)$
}
windowrule {
  name = autodesk-fusion-floating
  float = on
  center = on
  border_size = 0
  match:class = ^(Autodesk Fusion)$
}