# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */  #
# For window rules and layerrules
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more

# NOTES: This is only for Hyprland > 0.48

# note for ja: This should NOT be implemented on Debian and Ubuntu

# windowrule - tags - add apps under appropriate tag to use the same settings
# browser tags
windowrule = tag +browser, class:^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$
windowrule = tag +browser, class:^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$
windowrule = tag +browser, class:^(chrome-.+-Default)$ # Chrome PWAs
windowrule = tag +browser, class:^([Cc]hromium)$
windowrule = tag +browser, class:^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$
windowrule = tag +browser, class:^(Brave-browser(-beta|-dev|-unstable)?)$
windowrule = tag +browser, class:^([Tt]horium-browser|[Cc]achy-browser)$
windowrule = tag +browser, class:^(zen-alpha|zen)$

# notif tags
windowrule = tag +notif, class:^(swaync-control-center|swaync-notification-window|swaync-client|class)$

# KooL settings tag
windowrule = tag +KooL_Cheat, title:^(KooL Quick Cheat Sheet)$
windowrule = tag +KooL_Settings, title:^(KooL Hyprland Settings)$
windowrule = tag +KooL-Settings, class:^(nwg-displays|nwg-look)$

# terminal tags
windowrule = tag +terminal, class:^(Alacritty|kitty|kitty-dropterm)$

# email tags
windowrule = tag +email, class:^([Tt]hunderbird|org.gnome.Evolution)$
windowrule = tag +email, class:^(eu.betterbird.Betterbird)$

# project tags
windowrule = tag +projects, class:^(codium|codium-url-handler|VSCodium)$
windowrule = tag +projects, class:^(VSCode|code-url-handler)$
windowrule = tag +projects, class:^(jetbrains-.+)$ # JetBrains IDEs

# screenshare tags
windowrule = tag +screenshare, class:^(com.obsproject.Studio)$

# IM tags
windowrule = tag +im, class:^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$
windowrule = tag +im, class:^([Ff]erdium)$
windowrule = tag +im, class:^([Ww]hatsapp-for-linux)$
windowrule = tag +im, class:^(ZapZap|com.rtosta.zapzap)$
windowrule = tag +im, class:^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$
windowrule = tag +im, class:^(teams-for-linux)$
windowrule = tag +im, class:^(im.riot.Riot|Element)$ # Element Matrix client

# game tags
windowrule = tag +games, class:^(gamescope)$
windowrule = tag +games, class:^(steam_app_\d+)$

# gamestore tags
windowrule = tag +gamestore, class:^([Ss]team)$
windowrule = tag +gamestore, title:^([Ll]utris)$
windowrule = tag +gamestore, class:^(com.heroicgameslauncher.hgl)$

# file-manager tags
windowrule = tag +file-manager, class:^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$
windowrule = tag +file-manager, class:^(app.drey.Warp)$

# wallpaper tags
windowrule = tag +wallpaper, class:^([Ww]aytrogen)$

# multimedia tags
windowrule = tag +multimedia, class:^([Aa]udacious)$

# multimedia-video tags
windowrule = tag +multimedia_video, class:^([Mm]pv|vlc)$

# settings tags
windowrule = tag +settings, title:^(ROG Control)$
windowrule = tag +settings, class:^(wihotspot(-gui)?)$ # wifi hotspot
windowrule = tag +settings, class:^([Bb]aobab|org.gnome.[Bb]aobab)$ # Disk usage analyzer
windowrule = tag +settings, class:^(gnome-disks|wihotspot(-gui)?)$
windowrule = tag +settings, title:(Kvantum Manager)
windowrule = tag +settings, class:^(file-roller|org.gnome.FileRoller)$ # archive manager
windowrule = tag +settings, class:^(nm-applet|nm-connection-editor|blueman-manager)$
windowrule = tag +settings, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$
windowrule = tag +settings, class:^(qt5ct|qt6ct|[Yy]ad)$
windowrule = tag +settings, class:(xdg-desktop-portal-gtk)
windowrule = tag +settings, class:^(org.kde.polkit-kde-authentication-agent-1)$
windowrule = tag +settings, class:^([Rr]ofi)$

# viewer tags
windowrule = tag +viewer, class:^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$ # system monitor
windowrule = tag +viewer, class:^(evince)$ # document viewer 
windowrule = tag +viewer, class:^(eog|org.gnome.Loupe)$ # image viewer

# Some special override rules
windowrule = noblur, tag:multimedia_video*
windowrule = opacity 1.0, tag:multimedia_video*
 
# POSITION
# windowrule = center,floating:1 # warning, it cause even the menu to float and center.
windowrule = center, tag:KooL_Cheat*
windowrule = center, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*)
windowrule = center, title:^(ROG Control)$
windowrule = center, tag:KooL-Settings*
windowrule = center, title:^(Keybindings)$
windowrule = center, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$
windowrule = center, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$
windowrule = center, class:^([Ff]erdium)$
windowrule = move 72% 7%,title:^(Picture-in-Picture)$ 
#windowrule = move 72% 7%,title:^(Firefox)$ 

# windowrule to avoid idle for fullscreen apps
#windowrule = idleinhibit fullscreen, class:^(*)$
#windowrule = idleinhibit fullscreen, title:^(*)$
windowrule = idleinhibit fullscreen, fullscreen:1

# windowrule move to workspace
windowrule = workspace 1, tag:email*
windowrule = workspace 2, tag:browser*
#windowrule = workspace 3, class:^([Tt]hunar)$
#windowrule = workspace 3, tag:projects*
windowrule = workspace 5, tag:gamestore*
windowrule = workspace 7, tag:im*
windowrule = workspace 8, tag:games*

# windowrule move to workspace (silent)
windowrule = workspace 4 silent, tag:screenshare*
windowrule = workspace 6 silent, class:^(virt-manager)$
windowrule = workspace 6 silent, class:^(.virt-manager-wrapped)$
windowrule = workspace 9 silent, tag:multimedia*

# FLOAT
windowrule = float, tag:KooL_Cheat*
windowrule = float, tag:wallpaper*
windowrule = float, tag:settings*
windowrule = float, tag:viewer*
windowrule = float, tag:KooL-Settings*
windowrule = float, class:([Zz]oom|onedriver|onedriver-launcher)$
windowrule = float, class:(org.gnome.Calculator), title:(Calculator)
windowrule = float, class:^(mpv|com.github.rafostar.Clapper)$
windowrule = float, class:^([Qq]alculate-gtk)$
#windowrule = float, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$
windowrule = float, class:^([Ff]erdium)$
windowrule = float, title:^(Picture-in-Picture)$
#windowrule = float, title:^(Firefox)$

# windowrule - ######### float popups and dialogue #######
windowrule = float, title:^(Authentication Required)$
windowrule = center, title:^(Authentication Required)$
windowrule = float, class:(codium|codium-url-handler|VSCodium), title:negative:(.*codium.*|.*VSCodium.*)
windowrule = float, class:^(com.heroicgameslauncher.hgl)$, title:negative:(Heroic Games Launcher)
windowrule = float, class:^([Ss]team)$, title:negative:^([Ss]team)$
windowrule = float, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*)

windowrule = float, title:^(Add Folder to Workspace)$
windowrule = size 70% 60%, title:^(Add Folder to Workspace)$
windowrule = center, title:^(Add Folder to Workspace)$

windowrule = float, title:^(Save As)$
windowrule = size 70% 60%, title:^(Save As)$
windowrule = center, title:^(Save As)$

windowrule = float, initialTitle:(Open Files)
windowrule = size 70% 60%, initialTitle:(Open Files)

windowrule = float, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background
windowrule = center, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background
windowrule = size 16% 12%, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background
# END of float popups and dialogue #######

# OPACITY
windowrule = opacity 0.9 0.7, tag:browser*
windowrule = opacity 0.9 0.8, tag:projects*
windowrule = opacity 0.94 0.86, tag:im*
windowrule = opacity 0.94 0.86, tag:multimedia*
windowrule = opacity 0.9 0.8, tag:file-manager*
windowrule = opacity 0.8 0.7, tag:terminal*
windowrule = opacity 0.8 0.7, tag:settings*
windowrule = opacity 0.82 0.75, tag:viewer*
windowrule = opacity 0.9 0.7, tag:wallpaper*
windowrule = opacity 0.8 0.7, class:^(gedit|org.gnome.TextEditor|mousepad)$
windowrule = opacity 0.9 0.8, class:^(deluge)$
windowrule = opacity 0.9 0.8, class:^(seahorse)$ # gnome-keyring gui
windowrule = opacity 0.95 0.75, title:^(Picture-in-Picture)$
windowrule = opacity 0.9,class:^(code)$

# SIZE
windowrule = size 65% 90%, tag:KooL_Cheat*
windowrule = size 70% 70%, tag:wallpaper*
windowrule = size 70% 70%, tag:settings*
windowrule = size 60% 70%, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$
windowrule = size 60% 70%, class:^([Ff]erdium)$

#windowrule = size 25% 25%, title:^(Picture-in-Picture)$   
#windowrule = size 25% 25%, title:^(Firefox)$ 

# PINNING
windowrule = pin, title:^(Picture-in-Picture)$
#windowrule = pin,title:^(Firefox)$ 

# windowrule - extras
windowrule = keepaspectratio, title:^(Picture-in-Picture)$

# BLUR & FULLSCREEN
windowrule = noblur, tag:games*
windowrule = fullscreen, tag:games*


#This not gonna take the focus to the window that appears when hovering over some of the parts of the IntelliJ Products 
windowrule = noinitialfocus, class:^(jetbrains-*)
windowrule = noinitialfocus, title:^(wind.*)$

#This will gonna make the VS Code bluer like other apps 
windowrule = opacity 0.8,class:^(code)$

#windowrule = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1
#windowrule = bordercolor rgb(282737) rgb(1E1D2D), floating:1
#windowrule = opacity 0.8 0.8, pinned:1

# LAYER RULES
layerrule = blur, rofi
layerrule = ignorezero, rofi
layerrule = blur, notifications
layerrule = ignorezero, notifications
layerrule = blur, quickshell:overview
layerrule = ignorezero, quickshell:overview
layerrule = ignorealpha 0.5, quickshell:overview

#layerrule = ignorealpha 0.5, tag:notif*

#layerrule = ignorezero, class:^([Rr]ofi)$
#layerrule = blur, class:^([Rr]ofi)$
#layerrule = unset,class:^([Rr]ofi)$
#layerrule = ignorezero, <rofi>

#layerrule = ignorezero, overview
#layerrule = blur, overview
