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.

If you run your own window script, what does it trigger on: lock, sleep, or a hotkey?

15 views

Add a comment

Replies

Best

i 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?

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?