Logout - macadmins/outset GitHub Wiki
Logout Scripts
Logout is not a directly supported action as macOS does not supply a convenient mech, however creative use of login-window could get you part of the way:
- create a
login-everyorboot-everyscript that touches a flag file indicating a login event for that user has occurred - create a
login-windowscript that checks for the presence of the flag and perform processing before removing the flag
This workflow has the advantage that the "logout" script will run whether the user logged out or performed a reboot
Other options
@aysiu has created a fork of Outset 3 called Offset which will handle scripts at logout.