Skip to content

Instantly share code, notes, and snippets.

@narendrans
Last active August 29, 2015 13:56
Show Gist options
  • Save narendrans/12164f5cca046e007f30 to your computer and use it in GitHub Desktop.
Save narendrans/12164f5cca046e007f30 to your computer and use it in GitHub Desktop.
#!/bin/sh
# This script mutes system volume during logout or shutdown. To prevent the system from giving the sound during bootup.
touch /Users/naren/Development/shell/mute.sh
echo "#!/bin/sh\nsudo osascript -e \"set Volume 0\"" > /Users/naren/Development/shell/mute.sh
# elevate privileges
sudo chmod +x /Users/naren/Development/shell/mute.sh
# This line hooks the script to logout
sudo defaults write com.apple.loginwindow LogoutHook /Users/naren/Development/shell/mute.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment