Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to add login and logout sounds to my Mac. How can I do this?

share|improve this question
up vote 1 down vote accepted

Save a script like this as ~/Desktop/test and make it executable with chmod +x ~/Desktop/test.


afplay /System/Library/Sounds/Blow.aiff

You can then add a LogoutHook key to /var/root/Library/Preferences/ with sudo defaults write LogoutHook ~/Desktop/test. It can be deleted with sudo defaults delete LogoutHook. You can run a script at login by adding a LoginHook key or by using launchd.

See also these questions about running scripts on logout and login and Daemons and Services Programming Guide: Customizing Login and Logout.

share|improve this answer

Your Answer


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.