Created
October 4, 2016 02:41
-
-
Save joshwnj/042c943e68d748515e79e43e634e1f6a to your computer and use it in GitHub Desktop.
hammerspoon config for window resizing / moving in a grid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local hotkey = require "hs.hotkey" | |
local grid = require "hs.grid" | |
grid.MARGINX = 10 | |
grid.MARGINY = 10 | |
grid.GRIDHEIGHT = 3 | |
grid.GRIDWIDTH = 7 | |
local mash = {"cmd", "alt", "ctrl"} | |
local mashshift = {"cmd", "alt", "ctrl", "shift"} | |
local slightmash = {"cmd", "ctrl"} | |
--Move windows | |
hotkey.bind(mash, 'DOWN', grid.pushWindowDown) | |
hotkey.bind(mash, 'UP', grid.pushWindowUp) | |
hotkey.bind(mash, 'LEFT', grid.pushWindowLeft) | |
hotkey.bind(mash, 'RIGHT', grid.pushWindowRight) | |
--Move windows slightly | |
hotkey.bind(slightmash, 'DOWN', grid.pushWindowDown) | |
hotkey.bind(slightmash, 'UP', grid.pushWindowUp) | |
hotkey.bind(slightmash, 'LEFT', grid.pushWindowLeft) | |
hotkey.bind(slightmash, 'RIGHT', grid.pushWindowRight) | |
--resize windows | |
hotkey.bind(mashshift, 'UP', grid.resizeWindowShorter) | |
hotkey.bind(mashshift, 'DOWN', grid.resizeWindowTaller) | |
hotkey.bind(mashshift, 'RIGHT', grid.resizeWindowWider) | |
hotkey.bind(mashshift, 'LEFT', grid.resizeWindowThinner) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment