Skip to content

Instantly share code, notes, and snippets.

@lmullen
Created February 8, 2013 04:19
Show Gist options
  • Save lmullen/4736568 to your computer and use it in GitHub Desktop.
Save lmullen/4736568 to your computer and use it in GitHub Desktop.
My configuration file for the Slate window manager
# GLOBAL CONFIGURATIONS
# -------------------------------------------------------------------
# See https://github.com/jigish/slate/wiki/Global-Configs
config defaultToCurrentScreen true
config secondsBeforeRepeat 0.4
config secondsBetweenRepeat 0.1
config keyboardLayout "qwerty"
config nudgePercentOf screenSize
config resizePercentOf screenSize
# HYPER KEY
# -------------------------------------------------------------------
# The "hyper" key is a shortcut for CTRL + ALT + CMD
alias hyper ctrl;alt;cmd
# MONITOR ALIASES
# -------------------------------------------------------------------
alias monitor-macbook 1280x800
alias monitor-dell 1440x900
# APPLICATION ALIASES AND BINDINGS
# -------------------------------------------------------------------
alias editor 'MacVim'
bind z:alt;shift focus ${editor}
alias terminal 'iTerm'
bind x:alt;shift focus ${terminal}
alias browser 'Google Chrome'
bind c:alt;shift focus ${browser}
bind t:${hyper} focus 'Twitter'
bind g:${hyper} focus 'Things'
bind v:cmd;shift focus 'nvALT'
# SLATE FEATURES
# -------------------------------------------------------------------
# Show quick key overlays for each window
config windowHintsShowIcons true
config windowHintsSpread true
config windowHintsIgnoreHiddenWindows false
bind h:cmd;shift hint ASDFHJKLQWERTYUIOPCVBNG
# Show a positioning grid for each monitor
bind g:cmd grid padding:5 0:6,2 1:8,3
# Better application switcher
# bind tab:cmd switch
# Reload Slate configuration file
bind s:${hyper} relaunch
# GENERAL POSITION ALIASES AND BINDINGS
# -------------------------------------------------------------------
# These positions are not tied to any screen. Each position gets an
# alias and then a keybinding. The keybindings are all mapped to the
# numberpad, with each row grouping a denominator.
# Keypad 5 = fullscreen
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
bind pad5:${hyper} ${full}
bind 5:${hyper} ${full}
# Keypad row 13 = halves
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
bind pad1:${hyper} ${lefthalf}
bind 1:${hyper} ${lefthalf}
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
bind pad3:${hyper} ${righthalf}
bind 3:${hyper} ${righthalf}
# Keypad row 46 = thirds
alias leftthird move screenOriginX;screenOriginY screenSizeX/3;screenSizeY
bind pad4:${hyper} ${leftthird}
bind 4:${hyper} ${leftthird}
alias righttwothirds move screenOriginX+screenSizeX/3;screenOriginY 2*screenSizeX/3;screenSizeY
bind pad6:${hyper} ${righttwothirds}
bind 6:${hyper} ${righttwothirds}
# Keypad row 79 = eighths
alias leftfifth move screenOriginX;screenOriginY screenSizeX/5;screenSizeY
bind pad7:${hyper} ${leftfifth}
bind 7:${hyper} ${leftfifth}
alias rightfourfifths move (screenOriginX+screenSizeX/5)+14;screenOriginY (4*screenSizeX/5)-14;screenSizeY
bind pad9:${hyper} ${rightfourfifths}
bind 9:${hyper} ${rightfourfifths}
# Keypad column 28 = top and bottom halves
alias tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2
bind pad8:${hyper} ${tophalf}
bind 8:${hyper} ${tophalf}
alias bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2
bind pad2:${hyper} ${bottomhalf}
bind 2:${hyper} ${bottomhalf}
# MONITOR-BASED POSITION ALIASES
# -------------------------------------------------------------------
# These aliases are move windows to specific positions on a specific
# monitor.
# Laptop monitor
alias macbook-full move screenOriginX;screenOriginY screenSizeX;screenSizeY ${monitor-macbook}
alias macbook-lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY ${monitor-macbook}
alias macbook-righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY ${monitor-macbook}
alias macbook-leftthird move screenOriginX;screenOriginY screenSizeX/3;screenSizeY ${monitor-macbook}
alias macbook-righttwothirds move screenOriginX+screenSizeX/3;screenOriginY 2*screenSizeX/3;screenSizeY ${monitor-macbook}
alias macbook-leftfifth move screenOriginX;screenOriginY screenSizeX/5;screenSizeY ${monitor-macbook}
alias macbook-rightfourfifths move (screenOriginX+screenSizeX/5)+45;screenOriginY (4*screenSizeX/5)-45;screenSizeY ${monitor-macbook}
alias macbook-tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2 ${monitor-macbook}
alias macbook-bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2 ${monitor-macbook}
# Dell monitor
alias dell-full move screenOriginX;screenOriginY screenSizeX;screenSizeY ${monitor-dell}
alias dell-lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY ${monitor-dell}
alias dell-righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY ${monitor-dell}
alias dell-leftthird move screenOriginX;screenOriginY screenSizeX/3;screenSizeY ${monitor-dell}
alias dell-righttwothirds move screenOriginX+screenSizeX/3;screenOriginY 2*screenSizeX/3;screenSizeY ${monitor-dell}
alias dell-leftfifth move screenOriginX;screenOriginY screenSizeX/5;screenSizeY ${monitor-dell}
alias dell-rightfourfifths move (screenOriginX+screenSizeX/5)+14;screenOriginY (4*screenSizeX/5)-14;screenSizeY ${monitor-dell}
alias dell-tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2 ${monitor-dell}
alias dell-bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2 ${monitor-dell}
# TWO MONITOR LAYOUT
# -------------------------------------------------------------------
layout 2monitors ${editor}:MAIN_FIRST ${macbook-lefthalf}
layout 2monitors ${terminal}:MAIN_FIRST ${macbook-righthalf}
layout 2monitors ${browser}:REPEAT ${dell-rightfourfifths}
layout 2monitors 'Twitter':REPEAT ${dell-leftfifth}
layout 2monitors 'Things':REPEAT ${dell-lefthalf}
layout 2monitors 'nvALT':REPEAT ${dell-righthalf}
# Bind a key to trigger this layout
bind pad*:${hyper} layout 2monitors
# Trigger this layout automatically when 2 monitors are present
default 2monitors resolutions:${monitor-macbook};${monitor-dell}
# ONE MONITOR LAYOUT
# -------------------------------------------------------------------
layout 1monitors ${editor}:MAIN_FIRST ${macbook-lefthalf}
layout 1monitors ${terminal}:MAIN_FIRST ${macbook-righthalf}
layout 1monitors ${browser}:REPEAT ${macbook-rightfourfifths}
layout 1monitors 'Twitter':REPEAT ${macbook-leftfifth}
layout 1monitors 'Things':REPEAT ${macbook-lefthalf}
layout 1monitors 'nvALT':REPEAT ${macbook-righthalf}
# Bind a key to trigger this layout
bind pad/:${hyper} layout 1monitors
bind /:${hyper} layout 1monitors
# Trigger this layout automatically when 1 monitors are present
default 1monitors resolutions:${monitor-macbook}
# BINDINGS
# -------------------------------------------------------------------
# Mostly taken from
# https://github.com/jigish/slate/blob/master/Slate/default.slate
# Focus
bind right:cmd;ctrl focus right
bind left:cmd;ctrl focus left
bind up:cmd;ctrl focus behind
bind down:cmd;ctrl focus behind
bind ]:alt;shift focus right
bind [:alt;shift focus left
bind =:alt;shift focus behind
# Throw
bind ]:${hyper} throw right resize full
bind [:${hyper} throw left resize full
# Resize
bind right:alt;cmd resize +5% +0
bind left:alt;cmd resize -5% +0
bind up:alt;cmd resize +0 -5%
bind down:alt;cmd resize +0 +5%
# Nudge
bind right:${hyper} nudge +10% +0
bind left:${hyper} nudge -10% +0
bind up:${hyper} nudge +0 -10%
bind down:${hyper} nudge +0 +10%
# Push
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment