-
Notifications
You must be signed in to change notification settings - Fork 0
/
slate
146 lines (108 loc) · 4.58 KB
/
slate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# SizeUp commands translated to Slate
# TODOs
# Spaces Actions
# fix SnapBack
# option to resize windows proportionally with Multiple Monitor actions
# option to resize window absolutely instead of relative to screen size with Center
# option to not resize window on Center
# SizeUp's "best effort" behavior
### Settings accessed through SizeUp's preferences window
# Screen Edge Margins
alias ScreenEdgeLeft 0
alias ScreenEdgeRight 0
alias ScreenEdgeUp 0
alias ScreenEdgeDown 0
# Partition (Between Window) Margins
alias PartitionX 0
alias PartitionY 0
# settings for Center with resizing relative to screen size
alias centerWidth 0.75
alias centerHeight 0.75
# Split Screen Partitions
alias SplitX 0.50
alias SplitY 0.50
# Quarter Screen Partitions
alias QuarterX 0.50
alias QuarterY 0.50
# aliases for Screen Edge Margins
alias sizeX (screenSizeX-${ScreenEdgeLeft}-${ScreenEdgeRight})
alias sizeY (screenSizeY-${ScreenEdgeUp}-${ScreenEdgeDown})
alias originX screenOriginX+${ScreenEdgeLeft}
alias originY screenOriginY+${ScreenEdgeUp}
# aliases used for Split Screen Partitions
alias splitLeft (${sizeX}*${SplitX}-(${PartitionX}/2))
alias splitRight (${sizeX}*(1-${SplitX})-(${PartitionX}/2))
alias splitUp (${sizeY}*(1-${SplitY})-(${PartitionY}/2))
alias splitDown (${sizeY}*${SplitY}-(${PartitionY}/2))
alias rightSplitOrigin ${originX}+${sizeX}*${SplitX}+(${PartitionX}/2)
alias downSplitOrigin ${originY}+${sizeY}*(1-${SplitY})+(${PartitionY}/2)
# aliases for Quarter Screen Partitions
alias quarterLeft ${sizeX}*${QuarterX}-(${PartitionX}/2)
alias quarterRight ${sizeX}*(1-${QuarterX})-(${PartitionX}/2)
alias quarterUp ${sizeY}*(1-${QuarterY})-(${PartitionY}/2)
alias quarterDown ${sizeY}*${QuarterY}-(${PartitionY}/2)
alias quarterRightOrigin ${originX}+${sizeX}*${QuarterX}+(${PartitionX}/2)
alias quarterDownOrigin ${originY}+${sizeY}*(1-${QuarterY})+(${PartitionY}/2)
# aliases for Centering, with resizing relative to screen size
alias centerXoffset ${sizeX}*((1-${centerWidth})/2)
alias centerYoffset ${sizeY}*((1-${centerHeight})/2)
alias centerOriginX ${originX}+${centerXoffset}
alias centerOriginY ${originY}+${centerYoffset}
alias centerSizeX ${sizeX}*${centerWidth}
alias centerSizeY ${sizeY}*${centerHeight}
# # settings for SnapBack
# config undoMaxStackSize 0
# config undoOps move,throw
### alias definitions to match SizeUp command names
alias Left move ${originX};${originY} ${splitLeft};${sizeY}
alias Right move ${rightSplitOrigin};${originY} ${splitRight};${sizeY}
alias Up move ${originX};${originY} ${sizeX};${splitUp}
alias Down move ${originX};${downSplitOrigin} ${sizeX};${splitDown}
alias UpperLeft move ${originX};${originY} ${quarterLeft};${quarterUp}
alias UpperRight move ${quarterRightOrigin};${originY} ${quarterRight};${quarterUp}
alias LowerLeft move ${originX};${quarterDownOrigin} ${quarterLeft};${quarterDown}
alias LowerRight move ${quarterRightOrigin};${quarterDownOrigin} ${quarterRight};${quarterDown}
alias FullScreen move ${originX};${originY} ${sizeX};${sizeY}
alias Center move ${centerOriginX};${centerOriginY} ${centerSizeX};${centerSizeY}
alias PrevMonitor throw previous
alias NextMonitor throw next
#screens
alias LeftMonitor 0
alias RightMonitor 1
### bindings / Shortcuts
bind h:ctrl;alt;cmd ${Left}
bind l:ctrl;alt;cmd ${Right}
bind k:ctrl;alt;cmd ${Up}
bind j:ctrl;alt;cmd ${Down}
bind h:shift;ctrl;alt ${UpperLeft}
bind k:shift;ctrl;alt ${UpperRight}
bind j:shift;ctrl;alt ${LowerLeft}
bind l:shift;ctrl;alt ${LowerRight}
bind m:ctrl;alt;cmd ${FullScreen}
bind c:ctrl;alt;cmd ${Center}
bind h:ctrl;alt ${PrevMonitor}
bind l:ctrl;alt ${NextMonitor}
alias FocusIterm focus 'iTerm'
alias FocusSlack focus 'Slack'
# Always put the move direction before the monitor
# Monitor must be a number, not an action(such as throw)
layout dualmonitors 'iTerm' ${FullScreen} ${RightMonitor}
layout dualmonitors 'Slack' ${FullScreen} ${LeftMonitor}
layout dualmonitors 'Adium' ${UpperRight} ${LeftMonitor}
layout dualmonitors 'Airmail' ${FullScreen} ${LeftMonitor}
layout dualmonitors 'Google Chrome' ${Center} ${RightMonitor}
# Leave iTerm & Slack as the final focus
layout dualmonitors AFTER ${FocusSlack}
layout dualmonitors AFTER ${FocusIterm}
#Single Monitor
layout singlemonitor 'iTerm' ${FullScreen}
layout singlemonitor 'Slack' ${Right}
layout singlemonitor 'Adium' ${UpperLeft}
layout singlemonitor 'Airmail' ${FullScreen}
layout singlemonitor 'Google Chrome' ${FullScreen}
# Leave iTerm on focus
layout dualmonitors AFTER ${FocusIterm}
default dualmonitors count:2
default singlemonitor count:1
bind d:ctrl;alt;cmd layout dualmonitors
bind s:ctrl;alt;cmd layout singlemonitor