Stop annoying "Boink", volume feedback and emptying the trash sounds in an open plan office!

tkimpton
Valued Contributor II

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
3 REPLIES 3

dmohs
Contributor

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/

Aziz
Valued Contributor

@dmohs

This won't work on OS X 10.11+ because of SIP

dmohs
Contributor

@Abdiaziz

Thank you for the advance notice, as I have not yet had a chance to try OS X 10.11.