Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This is a follow on question to

how to trap a suspend a resume from a bash script

How do you a trap the event that occurs when you close the lid and later reopen it from a bash script?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This StackOverflow question asks a very similar thing, just not bash-specific. The accepted answer states to try a program called Sleepwatcher for which the source is available.

From reading the source it seems like this program uses the apple-specific IORegisterForSystemPower function which allows the small C-daemon to be notified by the system before the syetm goes to sleep and after it wakes back up.

There is no generic ACPI daemon on Mac OS X that I know of.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.