# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules

# {{{ Floating windows
windowrule = float on, match:class discord
windowrule = float on, match:class mpv
windowrule = float on, match:class anki
windowrule = float on, match:class steam
windowrule = float on, match:class python, match:title Import
windowrule = float on, match:class zenity, match:title Japanese Analysis
windowrule = float on, match:class zenity, match:title Japanese Assistant
windowrule = min_size 1600 600, match:class anki
windowrule = max_size 2222 1234, match:class anki
windowrule = no_focus on, no_follow_mouse 1, float on, no_shadow on, no_anim on, match:class ueberzugpp.*

windowrule = size 1920 1080, match:class anki
# windowrule = min_size 1600 600, match:class anki
# windowrule = max_size 2222 1234, match:class anki
# }}}

# {{{ Workspace assignments
windowrule = workspace 3 silent, match:class Cursor
windowrule = workspace 5 silent, match:class GameSentenceMiner
windowrule = workspace 5 silent, match:class com.obsproject.Studio
windowrule = workspace 6 silent, match:class gamescope
windowrule = workspace 8 silent, match:class anki
windowrule = workspace 9 silent, match:class steam
windowrule = workspace 10 silent, match:class discord
# }}}

# {{{ Center floating windows
windowrule = match:float 1, match:class discord, center on
windowrule = match:float 1, match:class anki, center on
# }}}

# {{{ Opacity rules
# windowrule = opacity 0.88, match:class .* fullscreen:0
windowrule = opacity 1.0 override, match:class mpv
windowrule = opacity 1.0 override, match:class ^(remote-viewer)$
windowrule = opacity 1.0 override, match:class com.obsproject.Studio
windowrule = opacity 1.0 override, match:title (.*)(- YouTube(.*))
windowrule = opacity 1.0 override, match:class zen, match:title (.*)YouTube TV(.*)
windowrule = opacity 1.0 override, match:class anki
windowrule = opacity 1.0 override, match:title (.*)asbplayer
windowrule = opacity 1.0 override, match:class dolphin-emu
windowrule = opacity 1.0 override, match:class steam_app_default
windowrule = opacity 1.0 override, match:class steam_app.*
windowrule = opacity 1.0 override, match:class Rustdesk
windowrule = opacity 1.0 override, match:class google-chrome
# }}}

# {{{ Misc
windowrule = tile on, match:title (.*)asbplayer
# windowrule = size 2118 1182, match:class anki
# Ignore maximize requests from apps. You'll probably like this.
windowrule = suppress_event maximize, match:class .*
# Fix some dragging issues with XWayland
windowrule = no_focus on,match:class ^$,match:title ^$,match:xwayland 1,match:float 1,match:fullscreen 0,match:pin 0
# }}}

# {{{ Screen sharing workaround: https://wiki.hyprland.org/Useful-Utilities/Screen-Sharing/#xwayland
windowrule = opacity 0.0 override, match:class ^(xwaylandvideobridge)$
windowrule = no_anim on, match:class ^(xwaylandvideobridge)$
windowrule = no_initial_focus on, match:class ^(xwaylandvideobridge)$
windowrule = max_size 1 1, match:class ^(xwaylandvideobridge)$
windowrule = no_blur on, match:class ^(xwaylandvideobridge)$
windowrule = no_focus on, match:class ^(xwaylandvideobridge)$
# }}}

# {{{ GSM Overlay and LunaTranslator tweaks
windowrule = float on, match:class gsm_overlay
windowrule = border_size 0, match:class gsm_overlay
windowrule = xray off, match:class gsm_overlay
windowrule = no_shadow on, match:class gsm_overlay
windowrule = no_blur on, match:class gsm_overlay
windowrule = opacity 1.0 override, match:title LunaTranslator
windowrule = border_size 0, match:title LunaTranslator
windowrule = stay_focused on, match:class gsm_overlay
# windowrule = fullscreen_state 2, match:class gsm_overlay

windowrule = float on, match:class SubMiner
windowrule = border_size 0, match:class SubMiner
windowrule = xray off override, match:class SubMiner
windowrule = no_shadow on, match:class SubMiner
windowrule = no_blur on, match:class SubMiner
windowrule = no_dim on, match:class SubMiner
windowrule = opaque on, match:class SubMiner
windowrule = dim_around off, match:class SubMiner
windowrule = allows_input offf, match:class SubMiner
windowrule = border_size 0, match:class steam_app_1277940
windowrule = opacity 1.0 override, match:class SubMiner
# }}}

# {{{ FEH
windowrule = float on, match:class feh
windowrule = center on, match:class feh
windowrule = border_size 0, match:class feh
windowrule = no_shadow on, match:class feh
windowrule = no_blur on, match:class feh
windowrule = no_anim on, match:class feh
# }}}


windowrule = float on, match:title Picture in picture
windowrule = pin on, match:title Picture in picture

windowurle = no_vrr on, match:class mpv

# aibar popup (AI usage widget)
windowrule = float on, match:title aibar
windowrule = move 100%-374 50, match:title aibar
