You should be able to use Hammerspoon, I just think it brings with it a fair bit of extra configuration maintenance.