Created
January 15, 2017 01:09
-
-
Save s4kr4/f9b03fc8b3bfce79a797aebd593883f6 to your computer and use it in GitHub Desktop.
hammerspoon
This file contains 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 prefix = {"cmd", "ctrl"} | |
hs.hotkey.bind(prefix, "Up", 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 | |
f.h = max.h | |
win:setFrame(f) | |
end) | |
hs.hotkey.bind(prefix, "Left", 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(prefix, "Right", 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) | |
hs.hotkey.bind("alt", "tab", function() | |
hs.window.switcher.nextWindow() | |
end) | |
hs.hotkey.bind({"alt", "shift"}, "tab", function() | |
hs.window.switcher.previousWindow() | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment