Skip to content

Instantly share code, notes, and snippets.

@lapis-zero09
Last active August 1, 2019 03:59
Show Gist options
  • Save lapis-zero09/7669d6fbf289c03ec377c9b50bf9eeba to your computer and use it in GitHub Desktop.
Save lapis-zero09/7669d6fbf289c03ec377c9b50bf9eeba to your computer and use it in GitHub Desktop.
~/.hammerspoon
hs.window.animationDuration = 0
units = {
left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
left60 = { x = 0.00, y = 0.00, w = 0.60, h = 1.00 },
left80 = { x = 0.00, y = 0.00, w = 0.80, h = 1.00 },
right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
right60 = { x = 0.40, y = 0.00, w = 0.60, h = 1.00 },
right80 = { x = 0.20, y = 0.00, w = 0.80, h = 1.00 },
botright75 = { x = 0.45, y = 0.25, w = 0.55, h = 0.75 },
botleft75 = { x = 0.00, y = 0.25, w = 0.55, h = 0.75 },
}
mash = { 'shift', 'ctrl' }
hs.hotkey.bind(mash, ']', function() hs.window.focusedWindow():move(units.right50, nil, true) end)
hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.left50, nil, true) end)
hs.hotkey.bind(mash, 'j', function() hs.window.focusedWindow():move(units.left60, nil, true) end)
hs.hotkey.bind(mash, 'k', function() hs.window.focusedWindow():move(units.right60, nil, true) end)
hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left80, nil, true) end)
hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right80, nil, true) end)
hs.hotkey.bind(mash, 'Left', function() hs.window.focusedWindow():move(units.botleft75, nil, true) end)
hs.hotkey.bind(mash, 'Right', function() hs.window.focusedWindow():move(units.botright75, nil, true) end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment