Restore Mac windows after wake with a Hammerspoon script
If you are comfortable with a bit of Lua, Hammerspoon is the free way to put windows back after sleep. I wrote down the watchers it gives you, a short script that saves on lock or sleep and restores after wake, and the limits Hammerspoon's own documentation describes, like allWindows only seeing the current Space. I make a paid app for this, so the page also says when a script is all you need.
https://manydisplays.com/hammers...
If you run your own window script, what does it trigger on: lock, sleep, or a hotkey?
15 views


p/meridian-16
p/netfox
p/many-displays
p/runevr
p/google-cloud-platform
p/producthunt
p/reso
p/magic-lasso-adblock
p/dino-kids
p/gatrends
p/expert-chase-deleted-1107920
p/problemhunt
p/kodlo
p/slay-3
p/dex-by-exmergo
p/neoagent
p/skim-5
p/pretty-prompt
Replies
@martin_acunai liked that you've shared both the free script and its limitations. Which trigger has worked best in your experience: sleep, lock, or a hotkey?
@martin_acuna window positions getting messed up after waking a Mac can be frustrating. Does Hammer spoon also handle apps that take a few seconds to reopen their windows?