Skip to content

Instantly share code, notes, and snippets.

@mhuneke
Created February 27, 2013 14:49
Show Gist options
  • Save mhuneke/5048429 to your computer and use it in GitHub Desktop.
Save mhuneke/5048429 to your computer and use it in GitHub Desktop.
slate config
# Config's directive: config name value
# Default to the current screen if the screen the reference does not exist.
config defaultToCurrentScreen true
# The base value for nudge percent calculation
config nudgePercentOf screenSize
# The base value for resize percent calculation
config resizePercentOf screenSize
# Alias' directive: alias name value
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
alias leftthird move screenOriginX;screenOriginY screenSizeX/3;screenSizeY
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
alias rightthird move screenOriginX+screenSizeX/3+screenSizeX/3;screenOriginY screenSizeX/3; screenSizeY
alias middlethird move screenOriginX+screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY
alias tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2
alias bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2
alias topleft corner top-left resize:screenSizeX/2;screenSizeY/2
alias topright corner top-right resize:screenSizeX/2;screenSizeY/2
alias bottomleft corner bottom-left resize:screenSizeX/2;screenSizeY/2
alias bottomright corner bottom-right resize:screenSizeX/2;screenSizeY/2
# Layout's directive - layout name 'app name':OPTIONS operations
# Creates the aliases needed for this example
alias 0-full move screenOriginX;screenOriginY screenSizeX;screenSizeY 0
alias 1-full move screenOriginX;screenOriginY screenSizeX;screenSizeY 1
# oneDisplayLayout - Places iTerm in the left half and Firefox in the right half.
layout oneDisplayLayout 'iTerm':MAIN_FIRST #{lefthalf}
layout oneDisplayLayout 'Firefox':REPEAT #{righthalf}
# twoDisplayLayout - Places iTerm in full screen in the first display and Firefox in full screen in the second display
layout twoDisplayLayout 'iTerm':MAIN_FIRST #{0-full}
layout twoDisplayLayout 'Firefox':REPEAT #{1-full}
# Default's directive: default layout-or-snapshot-name screen-configuration
# Triggers the twoScreenLayout when there are 2 monitors.
default twoScreenLayout count:2
# Bind's directives: bind key:modifiers operation parameter+
bind key:modal-key operation parameter+
# Location - Sets the window to the specified location.
bind return:shift;cmd ${full}
bind k:shift;cmd ${tophalf}
bind j:shift;cmd ${bottomhalf}
bind h:shift;cmd ${lefthalf}
bind h:shift;alt;cmd ${leftthird}
bind i:shift;alt;cmd ${middlethird}
bind b:shift;cmd ${bottomleft}
bind y:shift;cmd ${topleft}
bind l:shift;cmd ${righthalf}
bind l:shift;alt;cmd ${rightthird}
bind .:shift;cmd ${bottomright}
bind p:shift;cmd ${topright}
# Resize - Resizes the window in the specified direction
bind l:alt resize +1% +0
# Nudge - Nudges the window in the specified direction
bind l:shift;alt nudge +1% +0
# Focus - Brings the focus to the window in the specified position
bind l:shift;ctrl focus right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment