Called just before your config is torn down,
or null to remove it. reason is "reload" when your config is being reloaded (including
by relaunching Hammerspoon 2, if Settings → Advanced → "Relaunch on reload" is on), or
"quit" when Hammerspoon 2 is quitting. Use it to undo anything that would outlast your
config, such as a system setting you changed, or to save state.
It's called before anything is shut down, so every module still works, and before the
shutdown() of any Spoons you've loaded (see the Spoons guide). It must finish its work
before it returns: your config is torn down straight afterwards, so timers, Promises and
callbacks it starts never complete. An exception it throws is logged, and doesn't stop
the teardown. Calling hs.reload() from it does nothing.
Processes started with hs.task are terminated straight after this callback and the
Spoons' shutdown() return. To run a command to completion, wait for it with
task.blockUntilExit(seconds), which gives up after the time you give it.
This replaces Hammerspoon 1's hs.shutdownCallback.
Called just before your config is torn down, or null to remove it.
reasonis"reload"when your config is being reloaded (including by relaunching Hammerspoon 2, if Settings → Advanced → "Relaunch on reload" is on), or"quit"when Hammerspoon 2 is quitting. Use it to undo anything that would outlast your config, such as a system setting you changed, or to save state.It's called before anything is shut down, so every module still works, and before the
shutdown()of any Spoons you've loaded (see the Spoons guide). It must finish its work before it returns: your config is torn down straight afterwards, so timers, Promises and callbacks it starts never complete. An exception it throws is logged, and doesn't stop the teardown. Callinghs.reload()from it does nothing.Processes started with
hs.taskare terminated straight after this callback and the Spoons'shutdown()return. To run a command to completion, wait for it withtask.blockUntilExit(seconds), which gives up after the time you give it.This replaces Hammerspoon 1's
hs.shutdownCallback.