Maximize window to screen half based on position of window (left or right side)

I'm seeking help to find out if I can achieve the following setup.

I use an ultrawide monitor and want to create a custom function that determines the position of the currently active window. Based on its position, the window should maximize to occupy either the left or right half of the screen.

For instance, if I'm using Chrome and it's primarily located on the left side of the screen, I want it to automatically expand to fill the left half of the screen. The same should apply for windows on the right side.

My goal is to mimic the functionality of dual monitors using my ultrawide monitor.

Thanks for your time and any assistance you can provide!

If you have just that single monitor it's relatively simple to achieve this using "advanced trigger conditions".

E.g. create two times the same keyboard shortcut.
For the first set the condition to only trigger if the focused windows's X position is less than 1600 (adapt that value to your resolution)

For the second set the condition to only trigger if the position is greater than 1600 (again adapt to your resolution)

But that still needs a shortcut :slightly_smiling_face:

But perhaps this idea can also be implemented with the trigger "Focused window changes", no :slightly_smiling_face:

Aha! That's awesome, thank you. I ended up using "mouse_position_x" instead, and that seems to work perfectly. You're the best!