Skip to content

Instantly share code, notes, and snippets.

@rozza
Created January 3, 2013 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rozza/4442676 to your computer and use it in GitHub Desktop.
Save rozza/4442676 to your computer and use it in GitHub Desktop.
My .slate configuration - use it to automatically place my apps when going to and from dual monitor.
# ~/.slate configuration
#
# Two modes:
#
# * Single Screen
# No real config, I manage this myself - aka TODO
#
# * Dual Screen
# I want chat and comms on my small monitor and out the way.
# Sublime, Chrome and iTerm on the big screen.
#
# Config
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config checkDefaultsOnLoad true
config windowHintsFontSize 100
config windowHintsTopLeftX (windowSizeX/2)-(windowHintsWidth/2)
config windowHintsTopLeftY (windowSizeY/2)-(windowHintsHeight/2)
# Monitor Aliases
alias mon-laptop 1280x800
alias mon-dell 1920x1080
# General aliases
alias sox screenOriginX
alias soy screenOriginY
alias ssx screenSizeX
alias ssy screenSizeY
# Position aliases
alias centered ${sox}+${ssx}/8;${soy}+${ssy}/8 ${ssx}/8*6;${ssy}/8*6
alias fullscreen ${sox};${soy} ${ssx};${ssy}
alias leftHalf ${sox};${soy} ${ssx}/2;${ssy}
alias bottomHalf ${sox};${soy}+${ssy}/2 ${ssx};${ssy}/2
alias topHalf ${sox};${soy} ${ssx};${ssy}/2
alias rightHalf ${sox}+${ssx}/2;${soy} ${ssx}/2;${ssy}
alias topLeftQuarter ${sox};${soy} ${ssx}/2;${ssy}/2
alias topRightQuarter ${sox}+${ssx}/2;${soy} ${ssx}/2;${ssy}/2
alias bottomLeftQuarter ${sox};${soy}+${ssy}/2 ${ssx}/2;${ssy}/2
alias bottomRightQuarter ${sox}+${ssx}/2;${soy}+${ssy}/2 ${ssx}/2;${ssy}/2
# Application aliases
alias adiumContacts move ${sox}+${ssx}-230;${soy}+80 ${sox}+150;${ssy}-140 ${mon-laptop}
alias adiumChat move ${sox}+40;${soy}+${ssy}/8 ${ssx}/9*6;${ssy}/8*6 ${mon-laptop}
alias things move ${sox}+${ssx}/8;${soy}+${ssy}/8+80 ${ssx}/8*6;${ssy}/8*6 ${mon-laptop}
alias limeChat move ${sox}+${ssx}/8-80;${soy}+${ssy}/8-80 ${ssx}/8*6;${ssy}/8*6 ${mon-laptop}
alias sublime move ${sox}+${ssx}/8;${soy}+${ssy}/9 ${ssx}/8*6;${ssy}-120 ${mon-dell}
alias chrome move ${sox}+${ssx}/15;${soy}+${ssy}/20 ${ssx}/8*6;${ssy}/8*6 ${mon-dell}
alias iterm move ${sox}+${ssx}/40;${soy}+${ssy}/4 ${ssx}/10*6;${ssy}-280 ${mon-dell}
# Layouts
default workLayout resolutions:${mon-laptop};${mon-dell}
# layout workLayout 'iTerm' move ${leftHalf}
layout workLayout 'Adium':TITLE_ORDER='Contacts' ${adiumContacts} | ${adiumChat}
layout workLayout 'LimeChat' ${limeChat}
layout workLayout 'Things' ${things}
layout workLayout 'Sublime Text 2':REPEAT ${sublime} | sequence ${sublime} | nudge +100 0
layout workLayout 'iTerm':REPEAT ${iterm} | sequence ${iterm} | nudge +100 0
layout workLayout 'Google Chrome':REPEAT ${chrome} | sequence ${chrome} | nudge +100 0
# Resize Bindings
bind right:alt resize +10% +0
bind left:alt resize -10% +0
bind up:alt resize +0 -10%
bind down:alt resize +0 +10%
bind right:ctrl;alt resize -10% +0 bottom-right
bind left:ctrl;alt resize +10% +0 bottom-right
bind up:ctrl;alt resize +0 +10% bottom-right
bind down:ctrl;alt resize +0 -10% bottom-right
# Push Bindings
bind right:ctrl;cmd push right bar-resize:screenSizeX/3
bind left:ctrl;cmd push left bar-resize:screenSizeX/3
bind up:ctrl;cmd push up bar-resize:screenSizeY/2
bind down:ctrl;cmd push down bar-resize:screenSizeY/2
# Nudge Bindings
bind right:shift;alt nudge +10% +0
bind left:shift;alt nudge -10% +0
bind up:shift;alt nudge +0 -10%
bind down:shift;alt nudge +0 +10%
# Throw Bindings
bind 1:ctrl;alt throw 0 resize
bind 2:ctrl;alt throw 1 resize
bind 3:ctrl;alt throw 2 resize
bind right:ctrl;alt;cmd throw right resize
bind left:ctrl;alt;cmd throw left resize
bind up:ctrl;alt;cmd throw up resize
bind down:ctrl;alt;cmd throw down resize
# Focus Bindings
bind right:cmd focus right
bind left:cmd focus left
bind up:cmd focus up
bind down:cmd focus down
bind up:cmd;alt focus behind
bind down:cmd;alt focus behind
# Window Hints
bind esc:cmd hint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment