Skip to content

Instantly share code, notes, and snippets.

@szhu
Last active April 8, 2025 20:41
Show Gist options
  • Save szhu/254b634be6a57473e20f048b3849acf8 to your computer and use it in GitHub Desktop.
Save szhu/254b634be6a57473e20f048b3849acf8 to your computer and use it in GitHub Desktop.
-- ~/.hammerspoon/init.lua
-- https://chatgpt.com/share/679c6282-322c-8007-9421-d7a0513d1a5f
hs.window.filter.default:subscribe(hs.window.filter.windowCreated, function(win)
print(win:application():bundleID())
-- if win:application():bundleID() == "com.microsoft.VSCode" then return end
if not win:isStandard() then return end
if win:tabCount() ~= nil and win:tabCount() > 1 then return end
if not win:isMaximizable() then return end
win:centerOnScreen()
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment