Skip to content

Instantly share code, notes, and snippets.

@alok
Created November 17, 2016 07:17
Show Gist options
  • Save alok/601383d7bfaed94d8fca27ac79fbc054 to your computer and use it in GitHub Desktop.
Save alok/601383d7bfaed94d8fca27ac79fbc054 to your computer and use it in GitHub Desktop.
hs.hotkey.bind({"shift", "ctrl"}, "T", 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({"shift", "ctrl"}, "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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment