1

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

daviesgeek
  • 38,901
  • 52
  • 159
  • 203

2 Answers2

1

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

#!/bin/bash

afplay /System/Library/Sounds/Blow.aiff

You can then add a LogoutHook key to /var/root/Library/Preferences/com.apple.loginwindow.plist with sudo defaults write com.apple.loginwindow LogoutHook ~/Desktop/test. It can be deleted with sudo defaults delete com.apple.loginwindow 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.

Lri
  • 105,117
-1

Just write this Shutdown maybe that will work

Shutdown