Slate is an open source window management tool geared towards power users. It obviates the use of many paid tool such as Divvy and Stay. I am a long time Divvy user and was considering using Stay to manage window arrangements, until I found Slate. Slate is configured through a .slate file that will be familiar to users of vim. The full documentation can be found on Slate’s github page and I highly recommend this article on getting set up. What I would like to share below is a quick and dirty setup with slate that I found works for removing my need for Divvy, adding a cool new feature, and demonstrating a simple window management.
Here is my config file in full:
Let me walk you through the individual pieces. The config section sets some basic attributes of how Slate should behave. The comment section above explains what I am setting.
When you first get started with Slate you will want to create aliases for the monitors that you use. The easiest way to do this is to open up Slate’s ‘Current Window’ option by clicking on the menu bar icon:
At the top of the Current Window tool you will see something like:
It should be fairly obvious which screen is which to you, but if it is not you can always goto System Preferences and look at your Displays and their resolutions/IDs.
Then you can define aliases for your screens in your config:
Following monitor configuration, I configured aliases for a simple grid structure because I generally use divvy to just place windows in four square grid (top left, top right, etc.).
Creates an alias for the combination of pressing ⌘+Ctrl+Shift+Option at once.
Next we come to defining layouts. Here I am creating a single layout that I call 2monitors . The definition starts with the word layout then the name of the layout then I use an alias to where the window of the application should lie in the Grid and finally I use a monitor alias to define the screen that it should lie on.
essentially says: As part of the layout “2monitors” place the window for iTunes in full screen on the screen mon-laptop (laptop monitor).
The complete rule set is this:
Which means put the windows for iTunes, Slack, iTerm on my laptop monitor with iTerm on top. Then place Chrome on the right half of my dell monitor and Sublime Text on the left half of dell monitor
Next I define a series of key bindings that match with the way I was using Divvy.
⌘+Ctrl+(left arrow key|right arrow key) places the focused window on the left or right half of the screen.
⌘+Ctrl+up or Hyper + f full sizes the window on the screen
Similarly I map the ten key numbers to a four corner grid:
These two bindings allow for quick placement of a window on another monitor via ⌘+Ctrl+Option+(left arrow key|right arrow key).
Slate provides window hints which allow you to quickly switch between windows via hints. In my case I set ⌘+e to display the window hints and then QWERTYUIOP as the possible keys that can be used as hints.
The following bindings allow for quick switching by using Hyper + a key to
Finally I set a binding to trigger the 2monitors layout I defined above: