since os x yosemite 10.10.3, mac users are able to add the charging chime, everyone knows from their ios devices. it's just this simple line to activate the setting:

defaults write ChimeOnAllHardware -bool true; open /System/Library/CoreServices/

open (which can be found in /applications/utilities), paste the entire line and press enter.

if you are sick of listening to this sound, just run the following command to deactivate the charging chime:

defaults delete; killall PowerChime
main picture by roman drits, license