3 ms·
If anyone should wander into this thread looking for Mac OS X equivalents, I thought I would note: Apple provides window-manipulation APIs via its Open Scripti
by isomorphic 11y ago
If anyone should wander into this thread looking for Mac OS X equivalents, I thought I would note: Apple provides window-manipulation APIs via its Open Scripting Architecture (OSA). Previously that meant you had to use AppleScript for best results--I won't comment on AppleScript except to say that as of Yosemite, Apple treats JavaScript as a first-class OSA citizen.
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 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.
- michaelsbradley 11y agoHave you tried Phoenix? https://github.com/kasper/phoenix 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.
- daurnimator 11y agoSee also: Mjolnir: https://github.com/sdegutis/mjolnir https://github.com/sdegutis/mjolnir
- rz2k 11y agoHammerspoon is a fork that has enough community to keep the mailing list somewhat active. It sounded like Mjolnir might turn into the basis for a less low level, more polished commercial product, but there is little news. Anyway, both use Lua for configuring OS level controls of the environment and user interface.
- hobs 11y agoYeah, I remember scripting most of my work with ruby, bash, and the Applescript libraries that were included in most OSX apps. 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.
- pjc50 11y agoIs there an MSWindows equivalent? (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)