How can I automatically trigger a bash script before my Mac goes to sleep?

by sunknudsen   Last Updated August 13, 2019 22:12 PM

I am aware of the options suggested in Possible to run scripts on sleep and wake?.

I am ideally looking for a native option that doesn’t require installing a third-party app or binary.

The closest I found is SleepWatcher but it requires installing a third-party binary using brew install sleepwatcher.

Thanks!

Tags : macos


Related Questions


Updated November 10, 2018 20:12 PM

Updated November 18, 2018 19:12 PM

Updated November 13, 2018 22:12 PM

Updated October 24, 2016 09:05 AM

Updated November 26, 2016 07:15 AM