Slate Window Manager Grid

Update! I've updated my slate config to use JavaScript. The new grid is much easier to use and much more accurate. SlateGrid.js and my current slate config.

If you ever found apps like Divvy or SizeUp lacking, you should check out slate window manager. It is a free, open-source window manager for OSX that is very customizable.

A huge bonus of Slate is that it allows you to setup window layouts - specific places for specific windows. This is great for different scenarios: working, dealing with email, chatting, etc. Just setup a different layout and toggle between them when switching tasks for added productivity. The up-front cost kind of sucks, but it can be worth it.

One of the things I was struggling with was creating basic window layouts with it, and I devised a bootstrap-like grid "framework" for it. What it does is try to create a generic 12x12 grid on the screen, so you can push and pull app windows into specific coordinants, similar to how a CSS framework would do it.

The framework really just sets up some slate aliases that let you set window dimensions in a more human-friendly way. The aliases break down into 4 main categories:

span-{x}
Set the width of the window to X columns (1/12th of screen width)
row-{x}
Set the height of the window to X rows (1/12th of the screen)
push-{x}
Move the window X columns to the right
drop-{x}
Move the window X rows from the top

When using these with slate's move command you can quickly and easily setup a window arrangement that suits your needs.

Quick Example

Theres no easy way to demonstrate this without doing a video, which I'm most likely not going to get to, but here is a quick example of moving/sizing a Chrome window around the screen.

# EDIT: ~/.slate

# include our grid
source ~/.slate.grid if_exists

#== half-screen tests ==

# basic template for moving a window:
# layout <layout-name> '<window-title>' move  <start-x>;<start-y>  <width>;<height>

# position chrome on the left-half of the screen
# - start at 0,0 (left,top)
# - span-6, row-12 (half-width, full-height)
layout test-lh 'Google Chrome'    move    0;0                   ${span-6};${row-12}

# position chrome on the right-half of the screen
# - start at col-6, 0 (center of width,top)
# - span-6, row-12 (half-width, full-height)
layout test-rh 'Google Chrome'    move    ${push-6};0           ${span-6};${row-12}

# == quarter-screen tests ==

# position chrome in the top-left quarter
# - start at 0,0
# - span-6, row-6
layout test-tl 'Google Chrome'    move    0;0                   ${span-6};${row-6}

# position chrome in the top-right quarter
# - start at col-6,0
# - span-6, row-6
layout test-tr 'Google Chrome'    move    ${push-6};0           ${span-6};${row-6}

# position chrome in the bottom-left quarter
# - start at 0,drop-6 (left,center of height)
# - span-6, row-6
layout test-bl 'Google Chrome'    move    0;${drop-6}           ${span-6};${row-6}

# position chrome in the bottom-left quarter
# - start at 0,drop-6 (center of width,center of height)
# - span-6, row-6
layout test-br 'Google Chrome'    move    ${push-6};${drop-6}   ${span-6};${row-6}

# ctrl+alt+cmd+1 = move chrome to left half of screen
bind 1:ctrl;alt;cmd layout test-lh

# ctrl+alt+cmd+2 = move chrome to right half of screen
bind 2:ctrl;alt;cmd layout test-rh

# ctrl+alt+cmd+3 = move chrome to top-left quarter
bind 3:ctrl;alt;cmd layout test-tl

# ctrl+alt+cmd+4 = move chrome to top-right quarter
bind 4:ctrl;alt;cmd layout test-tr

# ctrl+alt+cmd+5 = move chrome to bottom-left quarter
bind 5:ctrl;alt;cmd layout test-bl

# ctrl+alt+cmd+6 = move chrome to bottom-right quarter
bind 6:ctrl;alt;cmd layout test-br

To see how I'm using this, you can check my slate config in my dotfiles. You can create some pretty nice layouts depending on how you set your windows up. It also aides in setting up keybindings to move windows around your screen, with the added benefit that it "snaps" to the grid, so windows generally align.

This is not perfect, but it should help you get a grasp on window placement with slate. Please contribute if you have any suggestions or bugfixes!

The grid

The raw details.