-
Notifications
You must be signed in to change notification settings - Fork 1
/
slate.js
86 lines (74 loc) · 2.32 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* File: slate.example.js
* Author: lunixbochs (Ryan Hileman)
* Project: http://github.com/lunixbochs/reslate
*/
S.src('.reslate.js')
// enable to see debug messages in Console.app
// $.debug = true;
slate.alias('hyper', 'ctrl;cmd')
// begin config
slate.configAll({
defaultToCurrentScreen: true,
nudgePercentOf: 'screenSize',
resizePercentOf: 'screenSize',
undoOps: [
'active-snapshot',
'chain',
'grid',
'layout',
'move',
'resize',
'sequence',
'shell',
'push',
],
})
// bindings
slate.bindAll({
hyper: {
shift: {
// edges
h: [$('barResize', 'left', 3), $('center', 'left', 3, 3)],
j: [$('barResize', 'bottom', 2), $('center', 'bottom', 3, 3)],
k: [$('barResize', 'top', 2), $('center', 'top', 3, 3)],
l: [$('barResize', 'right', 3), $('center', 'right', 3, 3)],
// corners
y: [$('corner', 'top-left', 3, 2), $('corner', 'top-left', 3, 3)],
i: [$('corner', 'top-right', 3, 2), $('corner', 'top-right', 3, 3)],
b: [$('corner', 'bottom-left', 3, 2), $('corner', 'bottom-left', 3, 3)],
m: [$('corner', 'bottom-right', 3, 2), $('corner', 'bottom-right', 3, 3)],
// centers
u: [$('center', 'top'), $('center', 'top', 3, 3)],
n: [$('center', 'bottom'), $('center', 'bottom', 3, 3)],
return: $('center', 'center', 3, 3),
},
// bars
h: [$('barResize', 'left', 2), $('barResize', 'left', 1.5)],
j: $('barResize', 'bottom', 2),
k: $('barResize', 'top', 2),
l: [$('barResize', 'right', 2), $('barResize', 'right', 1.5)],
// corners
y: [$('corner', 'top-left'), $('corner', 'top-left', 1.5)],
i: [$('corner', 'top-right'), $('corner', 'top-right', 1.5)],
b: [$('corner', 'bottom-left'), $('corner', 'bottom-left', 1.5)],
m: [$('corner', 'bottom-right'), $('corner', 'bottom-right', 1.5)],
// centers
u: $('center', 'top'),
n: $('center', 'bottom'),
return: $('center', 'center'),
// throw to monitor
'`': ['throw 0 resize', 'throw 1 resize'],
'1': $('toss', '0', 'resize'),
'2': $('toss', '1', 'resize'),
'3': $('toss', '2', 'resize'),
// direct focus
c: $.focus('Google Chrome'),
t: $.focus('Alacritty'),
f: $.focus('Finder'),
p: $.focus('Spotify'),
// utility functions
f1: 'relaunch',
z: 'undo',
tab: 'hint',
},
})