I am new to HS and I just try to implement a simple function to make my active window left half, here is my code, I’m confused as to why I have to press cmd+left three times to make this work?
hs.hotkey.bind({ "cmd" }, "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, 0)
end)
By the way, can anybody recommend me a hammerspoon learning community or some platform i can ask some simple question since i am just a newbie(The official discord is so quiet that no one answers questions……)
and here is what happened to my computer when i try this hotkey
Garon Lombard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.