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

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

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.


Tags : macos

Related Questions

can't see timeline in final cut pro

Updated November 10, 2018 20:12 PM

Issue about the external display on macOS Mojave

Updated November 18, 2018 19:12 PM

Macbook can‘t boot into mac OS

Updated November 13, 2018 22:12 PM

Where is Google Voice and Video installed?

Updated October 24, 2016 09:05 AM

How to clean system space

Updated November 26, 2016 07:15 AM