How do I disable the charging chime with Mojave on 2018 a MacBook? Searching for commands to disable the charge chime, I have run both of these. 

defaults write com.apple.PowerChime ChimeOnAllHardware -bool false; killall PowerChime

defaults write com.apple.PowerChime ChimeOnNoHardware -bool true;killall PowerChime


I still hear the sound. No answers here are selected and they conflict. 


Turning Power Chime Off


Can the chime be suppressed with Mojave?
In my case it did work after running this in the Terminal
(I am using a USB-C monitor for powering the MacBook Pro) 

defaults write com.apple.PowerChime ChimeOnNoHardware -bool true  
killall PowerChime


also this question discusses more ways to solve:


Turning Power Chime Off