#!/bin/bash
# Pre-configure float/size/position rules before launching
hyprctl keyword windowrulev2 "float,class:^(com.obsproject.Studio)$"
hyprctl keyword windowrulev2 "size 2487 1358,class:^(com.obsproject.Studio)$"
hyprctl keyword windowrulev2 "move 12 70,class:^(com.obsproject.Studio)$"

hyprctl keyword windowrulev2 "float,class:^(NoiseTorch)$"
hyprctl keyword windowrulev2 "size 2595 672,class:^(NoiseTorch)$"
hyprctl keyword windowrulev2 "move 2513 70,class:^(NoiseTorch)$"

hyprctl keyword windowrulev2 "float,class:^(hu.irl.cameractrls)$"
hyprctl keyword windowrulev2 "size 2595 672,class:^(hu.irl.cameractrls)$"
hyprctl keyword windowrulev2 "move 2513 756,class:^(hu.irl.cameractrls)$"

# [workspace 3 silent] handles workspace placement without switching focus
hyprctl dispatch exec "[workspace 3 silent] obs --startvirtualcam --scene 'Green Screen'"
hyprctl dispatch exec "[workspace 3 silent] noisetorch"
sleep 1
hyprctl dispatch exec "[workspace 3 silent] cameractrlsgtk4"

# Wait for windows to open then clean up the rules
sleep 3
hyprctl keyword windowrulev2 remove "float,class:^(com.obsproject.Studio)$"
hyprctl keyword windowrulev2 remove "size 2487 1358,class:^(com.obsproject.Studio)$"
hyprctl keyword windowrulev2 remove "move 12 70,class:^(com.obsproject.Studio)$"

hyprctl keyword windowrulev2 remove "float,class:^(NoiseTorch)$"
hyprctl keyword windowrulev2 remove "size 2595 672,class:^(NoiseTorch)$"
hyprctl keyword windowrulev2 remove "move 2513 70,class:^(NoiseTorch)$"

hyprctl keyword windowrulev2 remove "float,class:^(hu.irl.cameractrls)$"
hyprctl keyword windowrulev2 remove "size 2595 672,class:^(hu.irl.cameractrls)$"
hyprctl keyword windowrulev2 remove "move 2513 756,class:^(hu.irl.cameractrls)$"
