Skip to content

Instantly share code, notes, and snippets.

@yorch
Created January 19, 2015 01:12
Show Gist options
  • Save yorch/4893a929682ce01b44fe to your computer and use it in GitHub Desktop.
Save yorch/4893a929682ce01b44fe to your computer and use it in GitHub Desktop.
Slate Config file
var pushRight = slate.operation("push", {
"direction" : "right",
"style" : "bar-resize:screenSizeX/2"
});
var pushLeft = slate.operation("push", {
"direction" : "left",
"style" : "bar-resize:screenSizeX/2"
});
var pushTop = slate.operation("push", {
"direction" : "top",
"style" : "bar-resize:screenSizeY/2"
});
var pushDown = slate.operation("push", {
"direction" : "down",
"style" : "bar-resize:screenSizeY/2"
});
var resizeIncreaseWidthRight = slate.operation("resize", {
"width": "+10%",
"height": "+0"
});
var resizeDecreaseWidthRight = slate.operation("resize", {
"width": "-10%",
"height": "+0"
});
var resizeIncreaseWidthLeft = slate.operation("resize", {
"width": "+10%",
"height": "+0",
"anchor": "bottom-right"
});
var resizeDecreaseWidthLeft = slate.operation("resize", {
"width": "-10%",
"height": "+0",
"anchor": "bottom-right"
});
var fullscreen = slate.operation("move", {
"x" : "screenOriginX",
"y" : "screenOriginY",
"width" : "screenSizeX",
"height" : "screenSizeY"
});
var throwToNextScreen = slate.operation("throw", {
"screen": "next"
});
// Push bindings
slate.bind("right:ctrl,cmd", pushRight);
slate.bind("left:ctrl,cmd", pushLeft);
slate.bind("up:ctrl,cmd", pushTop);
slate.bind("down:ctrl,cmd", pushDown);
// Resize bindings
slate.bind(".:shift,alt", resizeIncreaseWidthRight);
slate.bind(",:shift,alt", resizeDecreaseWidthRight);
slate.bind(".:shift,ctrl", resizeDecreaseWidthLeft);
slate.bind(",:shift,ctrl", resizeIncreaseWidthLeft);
// Other binds
slate.bind("up:ctrl,cmd,alt", fullscreen);
slate.bind("n:ctrl,cmd,alt", throwToNextScreen);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment