Posted on 06-01-2013 12:41 PM
Kept meaning to address this for some time but ive been a bit lazy. Three different people around me doing it on Friday was the last straw!
Thought i would share this...
#!/bin/bash
##############################################################################################
#
# Created by Tim Kimpton
#
# 1/6/13
#
# Version 1.0
#
# This script is to stop annoying "boink audio systems sounds in the open plan office!
#
# This is to be used either with a policy or launch daemon to run at login
#
# This is to
#
# 1.disable user interface sound effects
#
# 2.disable feedback when volume is changed #
# 3.turn down the Alert volume.
#
# 4. mute the system volume
#
##############################################################################################
####################### ENVIRONMENT VARIABLES ########################
# Currently logged in user
user=`ls -l /dev/console | cut -d " " -f4`
###################### DO NOT MODIFY BELOW THIS LINE ##################
# Turn off "Play feedback when volume is changed as the logged in user
su "${user}" -c 'defaults write -g com.apple.sound.beep.feedback -integer 0'
# Turn off "Play user interface sound effects as the logged in user
su "${user}" -c 'defaults write com.apple.systemsound "com.apple.sound.uiaudio.enabled" -int 0'
# Turn the volume down the alert volume as the logged in user
su "${user}" -c 'defaults write com.apple.systemsound com.apple.sound.beep.volume -float 0'
exit 0
Posted on 12-07-2015 02:59 PM
Thank you. To complement this on a computer that I want to guarantee remains silent, I added line to the script
rm -rf /System/Library/Sounds/
rm -rf /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/accessibility/
rm -rf /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/dock/
rm -rf /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/finder/
rm -rf /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/ink/
rm -rf /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/system/
Posted on 12-07-2015 03:00 PM
This won't work on OS X 10.11+ because of SIP
Posted on 12-07-2015 04:02 PM
Thank you for the advance notice, as I have not yet had a chance to try OS X 10.11.