-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslate.js
64 lines (58 loc) · 2.14 KB
/
slate.js
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
// Global configs: https://github.com/jigish/slate/wiki/Global-Configs
// Layouts doc: https://github.com/jigish/slate/wiki/Layouts
// Some examples: https://github.com/mikegrb/slate.js/blob/master/.slate.js
// https://github.com/jigish/dotfiles/blob/master/slate.js
// https://github.com/krismolendyke/slate.js/blob/master/slate.js
// CONFIGS
S.cfga({
"defaultToCurrentScreen" : true,
"secondsBetweenRepeat" : 0.1,
"checkDefaultsOnLoad" : true,
"focusCheckWidthMax" : 3000,
"orderScreensLeftToRight" : true
});
// MONITORS (external up, internal down)
var externalScreen = "0",
internalScreen = "1";
// OPTIONS
var fullScreen = S.op("move", {
"x" : "screenOriginX",
"y" : "screenOriginY",
"width" : "screenSizeX",
"height": "screenSizeY"
});
var leftHalf = fullScreen.dup({"width" : "screenSizeX/2"});
var rightHalf = leftHalf.dup({"x": "screenOriginX+screenSizeX/2"});
var topHalf = fullScreen.dup({"height" : "screenSizeY/2"});
var bottomHalf = topHalf.dup({"y": "screenOriginY+screenSizeY/2"});
var leftTop = leftHalf.dup({"height" : "screenSizeY/2"});
var rightTop = rightHalf.dup({"height" : "screenSizeY/2"});
var leftBottom = bottomHalf.dup({"width" : "screenSizeX/2"});
var rightBottom = leftBottom.dup({"x": "screenOriginX+screenSizeX/2"});
var throwToExternal = S.op("throw", {
"screen" : externalScreen,
"width" : "screenSizeX",
"height" : "screenSizeY"
});
var throwToInternal = S.op("throw", {
"screen" : internalScreen,
"width" : "screenSizeX",
"height" : "screenSizeY"
});
// BINDS
S.bnda({
// "l:ctrl;alt;cmd" : slate.operation("layout", { "name" : externalMonitorLayout }),
"m:alt;cmd" : fullScreen,
"left:alt;cmd" : leftHalf,
"right:alt;cmd" : rightHalf,
"up:alt;cmd" : topHalf,
"down:alt;cmd" : bottomHalf,
"left:shift;cmd" : leftTop,
"up:shift;cmd" : rightTop,
"down:shift;cmd" : leftBottom,
"right:shift;cmd": rightBottom,
"up:ctrl;cmd" : throwToExternal,
"down:ctrl;cmd" : throwToInternal,
"esc:ctrl" : S.op("grid"),
"esc:cmd" : S.op("hint")
});