about summary refs log tree commit diff
path: root/configs/os_x/.slate.js
blob: 06740668a3b5d6e7ec53b6d0d7f6c8d61849ef05 (plain) (blame)
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
/* globals S,slate,_ */
// Bindings for slate.
// Forked from rschmukler/dotfiles
// Hotkeys for quickly opening apps & changing window size


var modal_key = ":alt;shift";

// Configs
S.cfga({
  defaultToCurrentScreen: true,
  secondsBetweenRepeat: 0.1,
  checkDefaultsOnLoad: true,
  focusCheckWidthMax: 3000,
});

// Window size /position shortcuts
// ctrl+shift+h = use left half of screen.
// ctrl+shift+l = right half, hjkl
// ctrl+shift+m = use full window

S.bnda({
  // Push Bindings
  "l:ctrl;shift" : S.op("move", { "x": "screenSizeX/2 + screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX*0.5 - 40", "height": "screenSizeY-100" }),
  ";:ctrl;shift" : S.op("move", { "x": "screenSizeX/3*2 + screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX/3 - 40", "height": "screenSizeY-100" }),

  "h:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX*0.5 - 40", "height": "screenSizeY-100" }),
  "g:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX/3*2 - 40", "height": "screenSizeY-100" }),

  "k:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX - 40", "height": "screenSizeY/2 - 20" }),
  "j:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenSizeY/2 + screenOriginY+20", "width": "screenSizeX - 40", "height": "screenSizeY/2 - 40" }),
  "m:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX - 40", "height": "screenSizeY - 100" }),
  "n:ctrl;shift" : S.op("move", { "x": "screenOriginX+screenSizeX/6", "y": "screenOriginY+20", "width": "2*screenSizeX/3", "height": "screenSizeY - 100" }),
  "b:ctrl;shift" : S.op("move", { "x": "screenOriginX+screenSizeX/4", "y": "screenOriginY+20", "width": "screenSizeX/2", "height": "screenSizeY - 100" }),
});


// Moves applications across multiple screens
var throwLeft  = slate.operation('throw', {screen: '0', width: 'screenSizeX', height: 'screenSizeY',});
var throwRight = slate.operation('throw', {screen: '1', width: 'screenSizeX', height: 'screenSizeY',});

slate.bind('1:ctrl', throwLeft);
slate.bind('2:ctrl', throwRight);


// Binds modal key + {char} to focus different open apps
// alt + d = focus Dash

var focus_apps = {
  1: '1Password',
  a: 'Atom',
  h: 'Dash',
  e: 'Emacs',
  t: 'iTerm2',
  m: 'Messages',
  s: 'Spotify',
  c: 'Google Chrome',
  l: 'LimeChat',
  k: 'Slack',
  w: 'Wireshark',
};


Object.keys(focus_apps).forEach(function(key) {
  app = focus_apps[key];
  S.bind(key + modal_key, S.op("focus", {app: app}));
});