Skip to content

Instantly share code, notes, and snippets.

@luisgerhorst
Last active December 22, 2015 12:48
Show Gist options
  • Save luisgerhorst/6474592 to your computer and use it in GitHub Desktop.
Save luisgerhorst/6474592 to your computer and use it in GitHub Desktop.
My Slate (github.com/jigish/slate) configs
slate.configAll({
gridBackgroundColor: [50, 50, 50, 0.95],
gridRoundedCornerSize: 3,
gridCellBackgroundColor: [0, 0, 0, 0.5],
gridCellSelectedColor: [70, 150, 255, 0.5],
gridCellRoundedCornerSize: 3
});
slate.bindAll({
// Grid
'f5': slate.operation('grid', {
grids: {
'1920x1080': {
width: 6,
height: 6
},
},
padding: 6
}),
// Move
'return:ctrl': slate.operation('move', {
x: '(screenSizeX-windowSizeX)/2',
y: '(screenSizeY-windowSizeY)/2',
width: 'windowSizeX',
height: 'windowSizeY'
}),
'left:ctrl': slate.operation('push', {
direction: 'left',
}),
'right:ctrl': slate.operation('push', {
direction: 'right',
}),
'up:ctrl': slate.operation('push', {
direction: 'up',
}),
'down:ctrl': slate.operation('push', {
direction: 'down',
}),
// Resize
'0:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX',
height: 'screenSizeY'
}),
'9:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX',
height: 'screenSizeY/6*5',
}),
'7:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/6*5',
height: 'screenSizeY',
}),
'6:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/3*2',
height: 'screenSizeY',
}),
'5:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/2',
height: 'screenSizeY',
}),
'4:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/3*1',
height: 'screenSizeY',
}),
'3:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/2',
height: 'screenSizeY/3*2',
}),
'2:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/3*1',
height: 'screenSizeY/2',
}),
'1:ctrl': slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/2',
height: 'screenSizeY/3*1',
}),
// Standard web dev layout
'1:ctrl,alt': function (win) {
slate.eachApp(function (app) {
switch (app.name()) {
case 'Chocolat':
app.eachWindow(slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/6*5',
height: 'screenSizeY',
}));
break;
case 'Safari':
app.eachWindow(slate.operation('move', {
x: 'screenOriginX+screenSizeX-screenSizeX/6*4',
y: 'screenOriginY',
width: 'screenSizeX/6*4',
height: 'screenSizeY',
}));
break;
case 'Finder':
app.eachWindow(slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX/6*3',
height: 'screenSizeY/6*4',
}));
break;
case 'Soulver':
app.eachWindow(slate.operation('move', {
x: 'screenOriginX',
y: 'screenOriginY+screenSizeY-screenSizeY/6*2',
width: 'screenSizeX/6*3',
height: 'screenSizeY/6*2',
}));
break;
case 'Transmit':
app.eachWindow(slate.operation('move', {
x: 'screenOriginX+screenSizeX-screenSizeX/6*3',
y: 'screenOriginY',
width: 'screenSizeX/6*3',
height: 'screenSizeY/6*4',
}));
break;
case 'Terminal':
app.eachWindow(slate.operation('move', {
x: 'screenOriginX+screenSizeX-screenSizeX/6*3',
y: 'screenOriginY+screenSizeY-screenSizeY/6*2',
width: 'screenSizeX/6*3',
height: 'screenSizeY/6*2',
}));
break;
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment