To activate the sound effect
$ defaults write com.apple.PowerChime ChimeOnAllHardware -bool true; open /System/Library/CoreServices/PowerChime.app &
Do deactivate it, simply change the ChimeOnAllHardware
boolean to false
.
$ defaults write com.apple.PowerChime ChimeOnAllHardware -bool false; open /System/Library/CoreServices/PowerChime.app &
Note: Do not include the
$
yourself.
You can use custom sounds for the chime.
-
Open the contents of the
PowerChime.app
$ open /System/Library/CoreServices/PowerChime.app/Contents/Resources
or you can use Finder and Go to Folder...
-
Make a backup of
connect_power.aif
(e.g.connect_power.aif~backup
. -
Drop any audio file of
AIFF (.aif)
format and rename it toconnect_power.aif
.
Note: Authentication may be required in order to change the contents.
Why is the defaults command run as a job with the
&
?