You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
3.8 KiB
JavaScript

/* global slate: true */
/* global screenSizeX: true */
/* global screenSizeY: true */
/* global screenOriginX: true */
/* global screenOriginY: true */
/* default configs
====================================================================== */
slate.configAll({
11 years ago
'checkDefaultsOnLoad': true,
'defaultToCurrentScreen': true,
'focusCheckWidthMax': 3000,
'modalEscapeKey': 'esc',
'nudgePercentOf': 'screenSize',
'resizePercentOf': 'screenSize',
'secondsBetweenRepeat': 0.1,
'windowHintsDuration': 5,
'windowHintsFontColor': '0;255;0;1.0',
'windowHintsFontName': 'Menlo',
'windowHintsFontSize': 60,
'windowHintsHeight': 72,
'windowHintsIgnoreHiddenWindows': false,
'windowHintsShowIcons': true,
'windowHintsSpread': true,
'windowHintsWidth': 72
});
/* operations
====================================================================== */
// show the overlay hints for applications
11 years ago
var hint = slate.operation('hint', {
'characters': 'jkl;asdfqwertyuiop[]zxcvbnm,'
});
// custom resize grids for all monitors 6x4
11 years ago
var grid = slate.operation('grid', {
'padding': 10,
'grids': {
'0': {
'width': 12,
'height': 8
},
11 years ago
'1': {
'width': 12,
'height': 8
},
11 years ago
'2': {
'width': 12,
'height': 8
}
}
});
// ultrafast application-switching
11 years ago
var iterm = slate.operation('focus', { 'app': 'iTerm' });
var chrome = slate.operation('focus', { 'app': 'Google Chrome' });
var mail = slate.operation('focus', { 'app': 'Mail' });
var fork = slate.operation('focus', { 'app': 'ForkLift' });
var ical = slate.operation('focus', { 'app': 'iCal' });
var fox = slate.operation('focus', { 'app': 'Firefox' });
var fullscreen = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY',
'width': 'screenSizeX',
'height': 'screenSizeY'
});
11 years ago
var lefthalf = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY',
'width': 'screenSizeX/2',
'height': 'screenSizeY'
});
11 years ago
var righthalf = slate.operation('move', {
'x': 'screenOriginX+screenSizeX/2',
'y': 'screenOriginY',
'width': 'screenSizeX/2',
'height': 'screenSizeY'
});
11 years ago
var tophalf = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY',
'width': 'screenSizeX',
'height': 'screenSizeY/2'
});
11 years ago
var bottomhalf = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY+screenSizeY/2',
'width': 'screenSizeX',
'height': 'screenSizeY/2'
});
11 years ago
var mobile = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY',
'width': '480',
'height': 'screenSizeY'
});
11 years ago
var tablet = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY',
'width': '1024',
'height': '768'
});
11 years ago
var desktop = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY',
'width': '1280',
'height': '800'
});
11 years ago
var fullhd = slate.operation('move', {
'x': 'screenOriginX',
'y': 'screenOriginY',
'width': '1920',
'height': '1080'
});
/* Key bindings
====================================================================== */
11 years ago
var hyper = ':shift,ctrl,alt,cmd';
var hyperModal = hyper + ',s:toggle';
11 years ago
slate.bind('tab:cmd', hint, false);
slate.bind('tab:shift,cmd', grid, false);
// most important apps on easy accesible keys
11 years ago
slate.bind('q' + hyper, iterm, false);
slate.bind('w' + hyper, chrome, false);
slate.bind('e' + hyper, mail, false);
slate.bind('r' + hyper, fork, false);
slate.bind('t' + hyper, ical, false);
// movements in modal mode with m
11 years ago
slate.bind('h' + hyperModal, lefthalf, false);
slate.bind('l' + hyperModal, righthalf, false);
slate.bind('k' + hyperModal, tophalf, false);
slate.bind('j' + hyperModal, bottomhalf, false);
slate.bind('1' + hyperModal, mobile, false);
slate.bind('2' + hyperModal, tablet, false);
slate.bind('3' + hyperModal, desktop, false);
slate.bind('4' + hyperModal, fullhd, false);
slate.bind('space' + hyperModal, fullscreen, false);