You might try Hammerspoon[0] with PaperWM.spoon[1] on macOS. This is what I use, and while it has quirks, it works better than not having it.
[0] https://www.hammerspoon.org/ [1] https://github.com/mogenson/PaperWM.spoon
[0] https://www.hammerspoon.org/ [1] https://github.com/mogenson/PaperWM.spoon
It took me about 30 minutes to replicate some Windows/AutoHotKey crap that I wrote myself and have been using for years, and it wasn't painful.