about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-05-22T15·22-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-05-22T15·22-0400
commit27e80a070ec6733a8b9f59bdbd444a383ecd265f (patch)
tree274334abe1d4c29f5fafea454dd8ac347653e117
parent3fca7bedbc59036138f97f23053a95bdc5e7d976 (diff)
Adds Slate as a window mgr
-rw-r--r--configs/.slate.js69
1 files changed, 69 insertions, 0 deletions
diff --git a/configs/.slate.js b/configs/.slate.js
new file mode 100644
index 000000000000..90de32b4ca12
--- /dev/null
+++ b/configs/.slate.js
@@ -0,0 +1,69 @@
+/* globals S,slate,_ */
+// Bindings for slate.
+// Forked from rschmukler/dotfiles
+// Hotkeys for quickly opening apps & changing window size
+
+
+var modal_key = ":s,ctrl";
+
+// 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" }),
+  "h:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX*0.5 - 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" }),
+});
+
+
+// Split dev layout
+
+function appIsOpen(name) {
+  var isOpen = false;
+  slate.eachApp(function(app) {
+    if (app.name == name) isOpen = true;
+  });
+  return isOpen;
+}
+
+
+// Binds modal key + {char} to focus different open apps
+// ctrl-s + h = focus hipchat
+// ctrl-s + f = focus iterm
+// etc, see below
+
+var focus_apps = {
+  f: 'iTerm2',
+  m: 'Messages',
+  x: 'Xcode',
+  i: 'iOS Simulator',
+  j: 'Jira',
+  p: 'Spotify',
+  c: 'Google Chrome',
+  g: 'Google Chrome',
+  s: 'Safari',
+  l: 'LimeChat',
+  k: 'Slack',
+  w: 'Workflowy',
+  t: 'iTunes'
+};
+
+
+_(focus_apps).forEach(function(app, key) {
+  S.bind(key + modal_key, S.op("focus", {app: app}));
+});