-
Notifications
You must be signed in to change notification settings - Fork 25
/
.slate.js
67 lines (53 loc) · 2.42 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
/*jshint esversion: 6 */
S.configAll({
defaultToCurrentScreen:true,
nudgePercentOf:'screenSize',
resizePercentOf:'screenSize',
secondsBetweenRepeat:0,
switchIconSize : 50,
switchShowTitles: true,
switchOnlyFocusMainWindow: false,
});
//const HYPER = 'ctrl,shift,alt,cmd';
const HYPER = 'f19';
const $ = {
x_left : 'screenOriginX',
x_cent : 'screenOriginX+screenSizeX/2',
y_top : 'screenOriginY',
y_cent : 'screenOriginY+screenSizeY/2',
x_full : 'screenSizeX',
x_half : 'screenSizeX/2',
y_full : 'screenSizeY',
y_half : 'screenSizeY/2',
};
var events = (function(){
var e = {};
e[`f:${HYPER}`] = S.operation('hint', { characters : 'ASDFHJKLQWER'});
e[`n:${HYPER}`] = S.operation('throw', { 'screen': 'previous' });
e[`b:${HYPER}`] = S.operation('throw', { 'screen': 'next' });
e[`g:${HYPER}`] = S.operation('grid');
e[`tab:alt`] = S.operation('switch');
const corner = S.operation('corner', { direction: 'top-left', width: $.x_half, height: $.y_half });
const focus = S.operation('focus', { direction: 'left'});
e[`1:${HYPER}`] = corner.dup({direction: 'bottom-left'});
e[`3:${HYPER}`] = corner.dup({direction: 'bottom-right'});
e[`7:${HYPER}`] = corner.dup({direction: 'top-left'});
e[`9:${HYPER}`] = corner.dup({direction: 'top-right'});
e[`2:${HYPER}`] = S.operation('push', { direction: 'bottom', style: `bar-resize:${$.y_half}`});
e[`4:${HYPER}`] = S.operation('push', { direction: 'left', style: `bar-resize:${$.x_half}`});
e[`5:${HYPER}`] = S.operation('push', { direction: 'left', style: `bar-resize:${$.x_full}`});
e[`6:${HYPER}`] = S.operation('push', { direction: 'right', style: `bar-resize:${$.x_half}`});
e[`8:${HYPER}`] = S.operation('push', { direction: 'top', style: `bar-resize:${$.y_half}`});
e[`h:${HYPER}`] = focus.dup({direction: 'left'});
e[`j:${HYPER}`] = focus.dup({direction: 'down'});
e[`k:${HYPER}`] = focus.dup({direction: 'up'});
e[`l:${HYPER}`] = focus.dup({direction: 'right'});
e[`p:${HYPER}`] = focus.dup({direction: 'behind'});
// e['c:f17'] = S.operation('focus', {app: 'Chrome'});
// e['e:f17'] = S.operation('focus', {app: 'Eclipse'});
// e['i:f17'] = S.operation('focus', {app: 'IntelliJ IDEA'});
// e['s:f17'] = S.operation('focus', {app: 'Slack'});
// e['v:f17'] = S.operation('focus', {app: 'MacVim'});
return e;
})();
S.bindAll(events);