One-click tile or cascade all windows

I've been looking for a single keystroke that neatly tiles (or cascades) all open windows of all apps, and leaves them there -- not just temporarily moves them out of the way like in Mission Control.

It would figure out the optimum layout for the number of open windows and grid them out. Like if there were 3 windows open, it would put them upper left, lower left, and upper right. If there were 8 windows open, it would put them in a 3 x 3 grid leaving one slot open. Etc. All with one keystroke.

Photoshop does this within the app. But I haven't been able to find a window manager that does it.

Photoshop can also cascade windows neatly rather than tile them.

unfortunately this is very complicated to implement as an external app and will most likely not be added to btt.

however there are some tools trying to get it right. Maybe have a look at https://github.com/ianyh/Amethyst (or in general search for tiling window manager)