Window Manipulation Utilities
wmutils.io
wmutils.io
This means, essentially, that one can write JavaScript window-manipulation scripts and run them with via shebang with "osascript". See here: https://github.com/dtinth/JXA-Cookbook
One can query an application's windows, then directly manipulate their position, size, and so forth in JavaScript.
I have some hacked-up stuff I use for my personal setup. I've found it works better for me than any of the other Mac OS X utilities for the purpose. Unfortunately I haven't extracted a common pattern for a general-purpose utility, but I can point people in the right direction if they want to roll-their-own.
https://github.com/kasper/phoenix
I realize it's not aiming for command-line manipulation, but I've found it helpful for doing keyboard-driven resizing and grid layouts just the way I want.
Anyway, both use Lua for configuring OS level controls of the environment and user interface.
My other favorite is that all the menu items also participate in this bridge and allow you to do a lot more than just move windows around.
(You can write your own window manager for the platform, and the existing one is highly extensible, but I've not seen this happen much apart from the occasional handy shell extension)
For example, this simple script allows me for an instant assigning of workspaces to outputs on my dual monitor setup:
i3-msg "move workspace to output VGA1; workspace $1"
i3-msg "move workspace to output HDMI2"
What it does, is it moves current workspace from primary to secondary output and then brings up requested workspace on primary output.
The beauty is that by quickly requesting 2 workspaces I can immediately assign workspaces to both outputs. After some usage muscle memory kicks in and now I can instantly set up whatever I want on both of my monitors without even thinking or fumbling with mouse.
I used to spend time configuring the hell out of xmonad and i3 until I realized that life is too short not to use a window manager with sane defaults while treating both the keyboard and the mouse as first class citizens.
wmii (for single monitor setups), cwm and dwm are good examples of that. Most mainstream desktops are also good.
Windows is excellent out of the box and the contextual file manager offers an unmatched experience across all operating systems.
OSX needs third party tools.