Last active
March 19, 2023 13:52
-
-
Save SamuelDavis/904c60f9403bdd79b17411d2840eb89b to your computer and use it in GitHub Desktop.
Hammerspoon Config
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
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "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({"cmd", "alt", "ctrl"}, "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({"cmd", "alt", "ctrl"}, "f", 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({"cmd", "alt", "ctrl"}, "Up", function() | |
local win = hs.window.focusedWindow() | |
local f = win:frame() | |
local screen = win:screen() | |
local max = screen:frame() | |
f.y = max.y | |
f.h = max.h / 2 | |
win:setFrame(f) | |
end) | |
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "Down", function() | |
local win = hs.window.focusedWindow() | |
local f = win:frame() | |
local screen = win:screen() | |
local max = screen:frame() | |
f.y = max.y + max.h / 2 | |
f.h = max.h / 2 | |
win:setFrame(f) | |
end) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment