Skip to content

Instantly share code, notes, and snippets.

@dongyuwei
Last active March 28, 2018 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongyuwei/8034059 to your computer and use it in GitHub Desktop.
Save dongyuwei/8034059 to your computer and use it in GitHub Desktop.
my slate config
var leftOneOfThree = slate.operation("push", {
"direction" : "left",
"style" : "bar-resize:screenSizeX/3"
});
var rightTwoOfThree = slate.operation("push", {
"direction" : "right",
"style" : "bar-resize:screenSizeX*2/3"
});
var pushTop = slate.operation("push", {
"direction" : "top",
"style" : "bar-resize:screenSizeY/2"
});
var pushBottom = slate.operation("push", {
"direction" : "bottom",
"style" : "bar-resize:screenSizeY/2"
});
var fullscreen = slate.operation("move", {
"x" : "screenOriginX",
"y" : "screenOriginY",
"width" : "screenSizeX",
"height" : "screenSizeY"
});
var middleRight = slate.operation("push", {
"direction" : "right",
"style" : "bar-resize:screenSizeX/2"
});
var middleLeft = slate.operation("push", {
"direction" : "left",
"style" : "bar-resize:screenSizeX/2"
});
slate.bindAll({
"1:alt,cmd,ctrl" : function(win){
win.doOperation(middleLeft);
},
"2:alt,cmd,ctrl" : function(win){
win.doOperation(middleRight);
},
"3:alt,cmd,ctrl" : function(win){
win.doOperation(leftOneOfThree);
},
"4:alt,cmd,ctrl" : function(win){
win.doOperation(rightTwoOfThree);
},
"5:alt,cmd,ctrl":function(win){
win.doOperation(pushTop);
},
"6:alt,cmd,ctrl":function(win){
win.doOperation(pushBottom);
},
"9:alt,cmd,ctrl" : function(win){
win.doOperation(fullscreen);
},
});
@dongyuwei
Copy link
Author

current used:

var leftOneOfThree = slate.operation("push", {
  "direction" : "left",
  "style" : "bar-resize:screenSizeX/3"
});
var rightTwoOfThree = slate.operation("push", {
  "direction" : "right",
  "style" : "bar-resize:screenSizeX*2/3"
});

var pushTop = slate.operation("push", {
  "direction" : "top",
  "style" : "bar-resize:screenSizeY/2"
});
var pushBottom = slate.operation("push", {
  "direction" : "bottom",
  "style" : "bar-resize:screenSizeY/2"
});

var fullscreen = slate.operation("move", {
  "x" : "screenOriginX",
  "y" : "screenOriginY",
  "width" : "screenSizeX",
  "height" : "screenSizeY"
});

var middleRight = slate.operation("push", {
  "direction" : "right",
  "style" : "bar-resize:screenSizeX/2"
});
var middleLeft = slate.operation("push", {
  "direction" : "left",
  "style" : "bar-resize:screenSizeX/2"
});

slate.bindAll({
  "f1:ctrl" : function(win){
    win.doOperation(middleLeft);
  },
  "f2:ctrl" : function(win){
    win.doOperation(middleRight);
  },
  "f3:ctrl" : function(win){
    win.doOperation(leftOneOfThree);
  },
  "f4:ctrl" : function(win){
    win.doOperation(rightTwoOfThree);
  },
  "f5:ctrl":function(win){
    win.doOperation(pushTop);
  },
  "f6:ctrl":function(win){
    win.doOperation(pushBottom);
  },
  "f9:ctrl" : function(win){
    win.doOperation(fullscreen);
  },
});

@dongyuwei
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment