I'll drop in the customary link to hammerspoon: http://www.hammerspoon.org
It has a couple libraries for window management. One is plug and play, the other is lower level. Here is my config for setting up a 2x2 grid: https://github.com/andrewhampton/dotfiles/blob/master/hammer...