Skip to content

Instantly share code, notes, and snippets.

@remarkablemark
Last active February 13, 2016 21:00
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 remarkablemark/c8b1bd62612a2d199426 to your computer and use it in GitHub Desktop.
Save remarkablemark/c8b1bd62612a2d199426 to your computer and use it in GitHub Desktop.
My Slate configuration.
'use strict';
/**
* Fullscreen (CTRL + F)
*/
slate.bind('f:ctrl', function(window) {
window.doOperation(move({
x: 'screenOriginX',
y: 'screenOriginY',
width: 'screenSizeX',
height: 'screenSizeY'
}));
});
/**
* Halfscreen Left-Aligned (ALT + Left)
*/
slate.bind('left:alt', function(window) {
window.doOperation(move({
x: '0',
y: 'screenOriginY',
width: 'screenSizeX / 2',
height: 'screenSizeY'
}));
});
/**
* Halfscreen Right-Aligned (ALT + Right)
*/
slate.bind('right:alt', function(window) {
window.doOperation(move({
x: 'screenSizeX / 2',
y: 'screenOriginY',
width: 'screenSizeX / 2',
height: 'screenSizeY'
}));
});
/**
* Constructs Slate operation for moving the window.
*
* @param {Object} options - The operation options.
* @return {Object} The Operation object.
*/
function move(options) {
return slate.operation('move', options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment