tvl-depot/configs/os_x/.slate.js

65 lines
2.5 KiB
JavaScript
Raw Normal View History

2017-05-22 17:22:30 +02:00
/* globals S,slate,_ */
// Bindings for slate.
// Forked from rschmukler/dotfiles
// Hotkeys for quickly opening apps & changing window size
2017-05-26 17:24:04 +02:00
var modal_key = ":alt";
2017-05-22 17:22:30 +02:00
// Configs
S.cfga({
"defaultToCurrentScreen" : true,
"secondsBetweenRepeat" : 0.1,
"checkDefaultsOnLoad" : true,
"focusCheckWidthMax" : 3000
});
// Window size /position shortcuts
// ctrl+shift+h = use left half of screen.
// ctrl+shift+l = right half, hjkl
// ctrl+shift+m = use full window
S.bnda({
// Push Bindings
"l:ctrl;shift" : S.op("move", { "x": "screenSizeX/2 + screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX*0.5 - 40", "height": "screenSizeY-100" }),
2017-05-26 17:24:04 +02:00
";:ctrl;shift" : S.op("move", { "x": "screenSizeX/3*2 + screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX/3 - 40", "height": "screenSizeY-100" }),
2017-05-22 17:22:30 +02:00
"h:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX*0.5 - 40", "height": "screenSizeY-100" }),
2017-05-26 17:24:04 +02:00
"g:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX/3*2 - 40", "height": "screenSizeY-100" }),
2017-05-22 17:22:30 +02:00
"k:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX - 40", "height": "screenSizeY/2 - 20" }),
"j:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenSizeY/2 + screenOriginY+20", "width": "screenSizeX - 40", "height": "screenSizeY/2 - 40" }),
"m:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX - 40", "height": "screenSizeY - 100" }),
"n:ctrl;shift" : S.op("move", { "x": "screenOriginX+screenSizeX/6", "y": "screenOriginY+20", "width": "2*screenSizeX/3", "height": "screenSizeY - 100" }),
"b:ctrl;shift" : S.op("move", { "x": "screenOriginX+screenSizeX/4", "y": "screenOriginY+20", "width": "screenSizeX/2", "height": "screenSizeY - 100" }),
});
2017-05-26 17:24:04 +02:00
// Moves applications across multiple screens
// S.bnda('1:ctrl,alt', S.op('throw', { screen: '0', style: 'resize' });
// S.bnda('2:ctrl,alt', S.op('throw', { screen: '1', style: 'resize' });
2017-05-22 17:22:30 +02:00
// Binds modal key + {char} to focus different open apps
2017-05-26 17:24:04 +02:00
// alt + d = focus Dash
2017-05-22 17:22:30 +02:00
var focus_apps = {
2017-08-01 15:43:59 +02:00
1: '1Password',
a: 'Atom',
2017-05-26 17:24:04 +02:00
h: 'Dash',
e: 'Emacs',
t: 'iTerm2',
2017-05-22 17:22:30 +02:00
m: 'Messages',
2017-06-01 16:26:57 +02:00
s: 'Spotify',
2017-05-22 17:22:30 +02:00
c: 'Google Chrome',
l: 'LimeChat',
2017-06-01 16:26:57 +02:00
k: 'Slack',
w: 'Wireshark',
2017-05-22 17:22:30 +02:00
};
2017-05-26 17:24:04 +02:00
Object.keys(focus_apps).forEach(function(key) {
app = focus_apps[key];
2017-05-22 17:22:30 +02:00
S.bind(key + modal_key, S.op("focus", {app: app}));
});