Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS hs.screen:fullFrame() doesn't work. #3727

Open
gaebalgombal opened this issue Dec 11, 2024 · 0 comments
Open

Mac OS hs.screen:fullFrame() doesn't work. #3727

gaebalgombal opened this issue Dec 11, 2024 · 0 comments

Comments

@gaebalgombal
Copy link

gaebalgombal commented Dec 11, 2024

I want to tile window to left or right, and hammerspoon API documentation says if you wanna include menu bar and dock, you should use "fullFrame". But it doesn't seem to be working. It still doesn't include menu bar and dock.

Below is My Code, and it is M1(Mac Sonoma).

hs.hotkey.bind(hyper, "Left", function()
    local win = hs.window.focusedWindow()
    local screen = win:screen()
    local f = win:frame()
    local max = screen:fullFrame()
  
    f.x = max.x
    f.y = max.y
    f.w = max.w / 2
    f.h = max.h
    win:setFrame(f)
end)
hs.hotkey.bind(hyper, "Right", function()
    local win = hs.window.focusedWindow()
    local screen = win:screen()
    local f = win:frame()
    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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant