#    __  _____  _____      __  _____          ___
#   /  |/  / / / / / | /| / / / ___/__  ___  / _/
#  / /|_/ / /_/_  _/ |/ |/ / / /__/ _ \/ _ \/ _/
# /_/  /_/____//_/ |__/|__/  \___/\___/_//_/_/
#

# Pavucontrol floating
windowrule = float,class:(.*org.pulseaudio.pavucontrol.*)
windowrule = size 700 600,class:(.*org.pulseaudio.pavucontrol.*)
windowrule = center,class:(.*org.pulseaudio.pavucontrol.*)
windowrule = pin,class:(.*org.pulseaudio.pavucontrol.*)

# OpenAI ChatGPT floating
windowrule = float,title:(ChatGPT.*)
windowrule = float,title:(.*chat.openai.com.*)
windowrule = size 500 50%,title:(.*chat.openai.com.*)
windowrule = move 20 70,title:(.*chat.openai.com.*)

# Waypaper
windowrule = float,class:(.*waypaper.*)
windowrule = size 900 700,class:(.*waypaper.*)
windowrule = center,class:(.*waypaper.*)
windowrule = pin,class:(.*waypaper.*)

# SwayNC
layerrule = blur, swaync-control-center
layerrule = blur, swaync-notification-window
layerrule = ignorezero, swaync-control-center
layerrule = ignorezero, swaync-notification-window
layerrule = ignorealpha 0.5, swaync-control-center
layerrule = ignorealpha 0.5, swaync-notification-window

# Newelle
windowrule = float,class:(io.github.qwersyk.Newelle)
windowrule = size 1000 700,class:(io.github.qwersyk.Newelle)
windowrule = center,class:(io.github.qwersyk.Newelle)
windowrule = pin,class:(io.github.qwersyk.Newelle)

# ML4W Calendar floating
windowrule = float,class:(com.ml4w.calendar)
windowrule = move 100%-w-16 66,class:(com.ml4w.calendar)
windowrule = pin, class:(com.ml4w.calendar)
windowrule = size 400 400,class:(com.ml4w.calendar)

# ML4W Sidebar floating
windowrule = float,class:(com.ml4w.sidebar)
windowrule = move 100%-w-16 66,class:(com.ml4w.sidebar)
windowrule = pin, class:(com.ml4w.sidebar)
windowrule = size 400 660,class:(com.ml4w.sidebar)

# ML4W Welcome App floating
windowrule = float,class:(com.ml4w.welcome)
windowrule = size 700 600,class:(com.ml4w.welcome)
windowrule = center,class:(com.ml4w.welcome)
windowrule = pin,class:(com.ml4w.welcome)

# ML4W Settings App floating
windowrule = float,class:(com.ml4w.settings)
windowrule = size 800 600,class:(com.ml4w.settings)
windowrule = move 10% 20%,class:(com.ml4w.settings)

# Blueman Manager
windowrule = float,class:(blueman-manager)
windowrule = size 800 600,class:(blueman-manager)
windowrule = center,class:(blueman-manager)

# nwg-look
windowrule = float,class:(nwg-look)
windowrule = size 700 600,class:(nwg-look)
windowrule = move 10% 20%,class:(nwg-look)
windowrule = pin,class:(nwg-look)

# nwg-displays
windowrule = float,class:(nwg-displays)
windowrule = size 900 600,class:(nwg-displays)
windowrule = move 10% 20%,class:(nwg-displays)
windowrule = pin,class:(nwg-displays)

# System Mission Center
windowrule = float, class:(io.missioncenter.MissionCenter)
windowrule = pin, class:(io.missioncenter.MissionCenter)
windowrule = center, class:(io.missioncenter.MissionCenter)
windowrule = size 900 600, class:(io.missioncenter.MissionCenter)

# System Mission Center Preference Window
windowrule = float, class:(missioncenter), title:^(Preferences)$
windowrule = pin, class:(missioncenter), title:^(Preferences)$
windowrule = center, class:(missioncenter), title:^(Preferences)$

# Gnome Calculator
windowrule = float,class:(org.gnome.Calculator)
windowrule = size 700 600,class:(org.gnome.Calculator)
windowrule = center,class:(org.gnome.Calculator)

# Hyprland Share Picker
windowrule = float, class:(hyprland-share-picker)
windowrule = pin, class:(hyprland-share-picker)
windowrule = center, title:class:(hyprland-share-picker)
windowrule = size 600 400,class:(hyprland-share-picker)

# General floating
windowrule = float,class:(dotfiles-floating)
windowrule = size 1000 700,class:(dotfiles-floating)
windowrule = center,class:(dotfiles-floating)

# Dotfiles Sidepad
windowrule = float,class:(dotfiles-sidepad)
windowrule = size 1000 700,class:(dotfiles-sidepad)
windowrule = center,class:(dotfiles-sidepad)
windowrule = pin,class:(dotfiles-sidepad)

# Float and center file pickers
windowrule = float, class:xdg-desktop-portal-gtk, title:^(Open.*Files?|Save.*Files?|All Files|Save)
windowrule = center, class:xdg-desktop-portal-gtk, title:^(Open.*Files?|Save.*Files?|All Files|Save)

# XDG Desktop Portal
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland

# QT
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_QPA_PLATFORMTHEME,qt6ct
env = QT_QPA_PLATFORMTHEME,qt5ct
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_AUTO_SCREEN_SCALE_FACTOR,1

# GDK
env = GDK_SCALE,1

# Toolkit Backend
env = GDK_BACKEND,wayland,x11,*
env = CLUTTER_BACKEND,wayland

# Mozilla
env = MOZ_ENABLE_WAYLAND,1

# Set the cursor size for xcursor
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24

# Ozone
env = OZONE_PLATFORM,wayland
env = ELECTRON_OZONE_PLATFORM_HINT,wayland

# XWayland
xwayland {
  force_zero_scaling = true
}