Skip to content

Instantly share code, notes, and snippets.

@SethMilliken
Created January 28, 2013 18:55
Show Gist options
  • Save SethMilliken/4658055 to your computer and use it in GitHub Desktop.
Save SethMilliken/4658055 to your computer and use it in GitHub Desktop.
My current `.slate` configuration. Some of this is already outdated. For example, slate recently learned how to use regexes for `TITLE_ORDER`.
# Configs
config checkDefaultsOnLoad false
config orderScreensLeftToRight true
config defaultToCurrentScreen true
config focusCheckWidthMax 3000
config focusPreferSameApp true
config gridBackgroundColor 0;0;0;0.5
config gridCellBackgroundColor 0;128;255;0.9
config gridCellRoundedCornerSize 3
config gridCellSelectedColor 255;200;100;1.0
config gridRoundedCornerSize 5
config nudgePercentOf screenSize
config repeatOnHoldOps resize,nudge,throw,chain
config resizePercentOf screenSize
config secondsBeforeRepeat 0.5
config secondsBetweenRepeat 0.1
config windowHintsBackgroundColor 50,53,58,0.7
config windowHintsDuration 4
config windowHintsFontColor 255;255;255;1.0
config windowHintsFontName Inconsolata
config windowHintsFontSize 24
config windowHintsHeight 50
config windowHintsIgnoreHiddenWindows true
config windowHintsRoundedCornerSize 5
config windowHintsWidth 100
# Display Aliases
alias d-external-h 1920x1200
alias d-external-slim 1920x1080
alias d-external-v 1200x1920
alias d-home-internal 1680x1050
alias d-work-1920i 1920x1200
alias d-work-internal 2880x1800
#alias d-work-internal 1440x900
# Position Aliases
alias bottom-half push bottom bar-resize:screenSizeY/2
alias top-half push top bar-resize:screenSizeY/2
alias left-half push left bar-resize:screenSizeX/2
alias right-half push right bar-resize:screenSizeX/2
alias right-third push right bar-resize:screenSizeX/3
alias left-third push left bar-resize:screenSizeX/3
alias middle-third move screenOriginX+screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY
alias top-third move screenOriginX+screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY/2
alias bottom-third move screenOriginX+screenSizeX/3;screenOriginY+screenSizeY/2 screenSizeX/3;screenSizeY/2
alias first-quadrant move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY/2
alias second-quadrant move screenOriginX;screenOriginY screenSizeX/2;screenSizeY/2
alias third-quadrant move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX/2;screenSizeY/2
alias fourth-quadrant move screenOriginX+screenSizeX/2;screenOriginY+screenSizeY/2 screenSizeX/2;screenSizeY/2
alias fill-screen move screenOriginX;screenOriginY screenSizeX;screenSizeY
alias alternate-halves ${left-half} | ${right-half}
alias halves-alternate ${right-half} | ${left-half}
alias quads-alternate ${first-quadrant} | ${second-quadrant} | ${third-quadrant} | ${fourth-quadrant}
alias alternate-quads ${fourth-quadrant} | ${third-quadrant} | ${second-quadrant} | ${first-quadrant}
# Chain Aliases
alias vhalves chain ${bottom-half} | ${top-half}
alias halves chain ${left-half} | ${right-half}
alias thirds chain ${right-third} | ${middle-third} | ${left-third}
alias quarts chain ${right-third} | ${top-third} | ${bottom-third} | ${left-third}
# Layouts
layout office 'iTerm':IGNORE_FAIL throw ${d-external-slim} resize | throw ${d-external-v} resize
layout office 'Adium':TITLE_ORDER=engage@conference.janrain.com;widget@conference.janrain.com;ops@conference.janrain.com;'Tony Vu';support@conference.janrain.com;capture@conference.janrain.com;watercooler@conference.janrain.com ${left-third} ${d-external-h} | ${top-third} ${d-external-h} | ${bottom-third} ${d-external-h} | ${right-third} ${d-external-h}
layout office 'Mail':IGNORE_FAIL throw ${d-external-v} resize
layout office 'Tasks':IGNORE_FAIL ${right-half} ${d-external-v}
layout office 'Google Chrome':IGNORE_FAIL,REPEAT ${fill-screen} ${d-external-slim}
layout office 'Skim':IGNORE_FAIL,REPEAT throw ${d-external-v} resize
layout office 'VM':IGNORE_FAIL throw ${d-external-slim} resize | throw ${d-external-v} resize
layout office 'Comm':IGNORE_FAIL,SORT_TITLE ${fill-screen} ${d-external-h} | ${fill-screen} ${d-external-slim}
layout office 'Remotes':IGNORE_FAIL,SORT_TITLE throw ${d-external-slim} resize | throw ${d-external-v} resize
layout office 'FirefoxBrowse':IGNORE_FAIL,REPEAT ${fill-screen} ${d-external-v}
layout office 'FirefoxResearch':IGNORE_FAIL,REPEAT ${fill-screen} ${d-external-h}
layout office 'FirefoxTest':IGNORE_FAIL,REPEAT ${fill-screen} ${d-external-v}
layout office 'FirefoxTrack':IGNORE_FAIL,SORT_TITLE throw ${d-external-slim} resize | throw ${d-external-h} resize | throw ${d-external-v} resize
layout office 'FirefoxMonitor':IGNORE_FAIL,SORT_TITLE throw ${d-external-v} resize | ${left-half} ${d-external-slim} | ${right-half} ${d-external-slim} | ${left-half} ${d-work-internal} | ${right-half} ${d-work-internal}
# Layouts
layout work-internal-only 'iTerm':IGNORE_FAIL,REPEAT ${fill-screen}
layout work-internal-only 'Adium':TITLE_ORDER=engage@conference.janrain.com;widget@conference.janrain.com;ops@conference.janrain.com;'Tony Vu';support@conference.janrain.com;capture@conference.janrain.com;watercooler@conference.janrain.com ${left-third} ${d-external-h} | ${top-third} ${d-external-h} | ${bottom-third} ${d-external-h} | ${right-third} ${d-external-h}
layout work-internal-only 'Mail':IGNORE_FAIL,REPEAT ${alternate-halves}
layout work-internal-only 'Tasks':IGNORE_FAIL,REPEAT ${right-half}
layout work-internal-only 'Scratch':IGNORE_FAIL,REPEAT ${alternate-halves}
layout work-internal-only 'Google Chrome':IGNORE_FAIL,REPEAT ${alternate-halves}
layout work-internal-only 'Skim':IGNORE_FAIL,REPEAT ${alternate-halves}
layout work-internal-only 'VM':IGNORE_FAIL,REPEAT ${fill-screen}
layout work-internal-only 'Comm':IGNORE_FAIL,REPEAT ${fill-screen}
layout work-internal-only 'Remotes':IGNORE_FAIL,SORT_TITLE,REPEAT ${alternate-halves}
layout work-internal-only 'FirefoxBrowse':IGNORE_FAIL,REPEAT ${alternate-halves}
layout work-internal-only 'FirefoxResearch':IGNORE_FAIL,REPEAT ${alternate-halves}
layout work-internal-only 'FirefoxTest':IGNORE_FAIL,REPEAT ${alternate-halves}
layout work-internal-only 'FirefoxTrack':IGNORE_FAIL,SORT_TITLE,REPEAT ${alternate-halves}
layout work-internal-only 'FirefoxMonitor':IGNORE_FAIL,SORT_TITLE,REPEAT ${alternate-halves}
layout work-internal-only 'Finder':IGNORE_FAIL,SORT_TITLE,REPEAT ${alternate-quads}
# Primary Bindings
bind `:cmd,ctrl throw next resize
bind 1:cmd,ctrl chain ${fill-screen} | throw next resize
bind 2:cmd,ctrl ${halves}
bind 3:cmd,ctrl ${thirds}
bind 4:cmd,ctrl ${quarts}
bind 5:cmd,ctrl ${vhalves}
# bind 6:cmd,ctrl ?
bind 7:cmd,ctrl chain ${quads-alternate}
bind 8:cmd,ctrl chain ${alternate-halves}
bind 9:cmd,ctrl layout work-internal-only
bind 0:cmd,ctrl layout office
bind g:cmd,ctrl grid padding:2 1440x900:12,8 1920x1200:16,9 1680x1050:16,9 1200x1920:9,16 1920x1080:16,9
# Throw Window Bindings: modal <D-C-q>, <D-C-w>, <D-C-e>, and <D-C-r>
bind q:q,ctrl,cmd ${fill-screen} 0
bind w:w,ctrl,cmd ${fill-screen} 1
bind e:e,ctrl,cmd ${fill-screen} 2
bind r:r,ctrl,cmd ${fill-screen} 3
bind 1:q,ctrl,cmd sequence throw 0 | ${left-half}
bind 1:w,ctrl,cmd sequence throw 1 | ${left-half}
bind 1:e,ctrl,cmd sequence throw 2 | ${left-half}
bind 1:r,ctrl,cmd sequence throw 3 | ${left-half}
bind 2:q,ctrl,cmd sequence throw 0 | ${right-half}
bind 2:w,ctrl,cmd sequence throw 1 | ${right-half}
bind 2:e,ctrl,cmd sequence throw 2 | ${right-half}
bind 2:r,ctrl,cmd sequence throw 3 | ${right-half}
bind 3:q,ctrl,cmd sequence throw 0 | ${left-third}
bind 3:w,ctrl,cmd sequence throw 1 | ${left-third}
bind 3:e,ctrl,cmd sequence throw 2 | ${left-third}
bind 3:r,ctrl,cmd sequence throw 3 | ${left-third}
bind 4:q,ctrl,cmd sequence throw 0 | ${top-half}
bind 4:w,ctrl,cmd sequence throw 1 | ${top-half}
bind 4:e,ctrl,cmd sequence throw 2 | ${top-half}
bind 4:r,ctrl,cmd sequence throw 3 | ${top-half}
# Window Hints
#bind esc:cmd hint QWERTASDFZXCV
#bind esc:cmd hint QAZWSXEDCRFVTGB
bind n:ctrl,cmd hint QWERTSDFGCVYUIOPHJKLBNM
# Defaults
default office resolutions:${d-work-internal};${d-external-h};${d-external-slim};${d-external-v}
default work-internal-only resolutions:${d-work-internal}
# Resize Bindings
bind right:ctrl,cmd resize +10% +0
bind left:ctrl,cmd resize -10% +0
bind up:ctrl,cmd resize +0 -10%
bind down:ctrl,cmd resize +0 +10%
bind right:alt,ctrl,cmd resize -10% +0 bottom-right
bind left:alt,ctrl,cmd resize +10% +0 bottom-right
bind up:alt,ctrl,cmd resize +0 +10% bottom-right
bind down:alt,ctrl,cmd resize +0 -10% bottom-right
# Nudge Bindings
##bind h:ctrl,cmd nudge -5% +0
##bind j:ctrl,cmd nudge +0 +5%
##bind k:ctrl,cmd nudge +0 -5%
##bind l:ctrl,cmd nudge +5% +0
# Throw Bindings
## bind h:ctrl;alt;cmd throw left resize
## bind j:ctrl;alt;cmd throw down resize
## bind k:ctrl;alt;cmd throw up resize
## bind l:ctrl;alt;cmd throw right 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
# Switch currently doesn't work well so I'm commenting it out until I fix it.
#bind tab:cmd switch
# Test Cases
source .slate.test if_exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment