-- GRID -- hs.window.animationDuration=0.1; local hotkey = require "hs.hotkey" local grid = require "hs.grid" grid.MARGINX = 0 grid.MARGINY = 0 grid.GRIDHEIGHT = 3 grid.GRIDWIDTH = 3 local mod_resize = {"alt"} local mod_move = {"alt", "shift"} hotkey.bind(mod_resize, 'm', grid.maximizeWindow) -- Move Window hotkey.bind(mod_move, 'k', grid.pushWindowDown) hotkey.bind(mod_move, 'i', grid.pushWindowUp) hotkey.bind(mod_move, 'j', grid.pushWindowLeft) hotkey.bind(mod_move, 'l', grid.pushWindowRight) -- Resize Window hotkey.bind(mod_resize, 'i', grid.resizeWindowShorter) hotkey.bind(mod_resize, 'k', grid.resizeWindowTaller) hotkey.bind(mod_resize, 'l', grid.resizeWindowWider) hotkey.bind(mod_resize, 'j', grid.resizeWindowThinner) hs.hotkey.bind({"alt"}, "B", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.x = max.x f.y = max.y f.w = max.w / 2 f.h = max.h win:setFrame(f) end) hs.hotkey.bind({"alt"}, "N", function() local win = hs.window.focusedWindow() local f = win:frame() local screen = win:screen() local max = screen:frame() f.x = max.x + (max.w / 2) f.y = max.y f.w = max.w / 2 f.h = max.h win:setFrame(f) end)