diff options
author | William Carroll <wpcarro@gmail.com> | 2017-06-23T17·01-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2017-06-23T17·01-0400 |
commit | f344f2e370fbf88a0306b6a01c99f386a13953c7 (patch) | |
tree | 81c19178bdc8986b59d3bca5e91efd9f01690941 /configs/os_x/.slate.js | |
parent | e51d11e4bc344f624ec90afd299ac1dcb5e6e1fb (diff) |
Adds os detection for bootstrapping configs
Diffstat (limited to 'configs/os_x/.slate.js')
-rw-r--r-- | configs/os_x/.slate.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/configs/os_x/.slate.js b/configs/os_x/.slate.js new file mode 100644 index 000000000000..21557111bc78 --- /dev/null +++ b/configs/os_x/.slate.js @@ -0,0 +1,61 @@ +/* globals S,slate,_ */ +// Bindings for slate. +// Forked from rschmukler/dotfiles +// Hotkeys for quickly opening apps & changing window size + + +var modal_key = ":alt"; + +// 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" }), + ";:ctrl;shift" : S.op("move", { "x": "screenSizeX/3*2 + screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX/3 - 40", "height": "screenSizeY-100" }), + + "h:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX*0.5 - 40", "height": "screenSizeY-100" }), + "g:ctrl;shift" : S.op("move", { "x": "screenOriginX+20", "y": "screenOriginY+20", "width": "screenSizeX/3*2 - 40", "height": "screenSizeY-100" }), + + "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" }), +}); + + +// 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' }); + + +// Binds modal key + {char} to focus different open apps +// alt + d = focus Dash + +var focus_apps = { + h: 'Dash', + e: 'Emacs', + t: 'iTerm2', + m: 'Messages', + s: 'Spotify', + c: 'Google Chrome', + l: 'LimeChat', + k: 'Slack', +}; + + +Object.keys(focus_apps).forEach(function(key) { + app = focus_apps[key]; + S.bind(key + modal_key, S.op("focus", {app: app})); +}); |