Skip to content

Instantly share code, notes, and snippets.

@JakobR
Last active December 24, 2015 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakobR/6826401 to your computer and use it in GitHub Desktop.
Save JakobR/6826401 to your computer and use it in GitHub Desktop.
Disable Mac startup sound

Disable Mac startup sound

The startup sound doesn't play if the audio output was muted at shutdown.

  1. Copy login.sh and logout.sh to /Library/Scripts. Make sure they're executable and owned by root.

  2. Check if there are any existing login/logout hooks (they will be overwritten):

    sudo defaults read com.apple.loginwindow LoginHook
    sudo defaults read com.apple.loginwindow LogoutHook
  3. Add the hooks:

    sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/login.sh
    sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/logout.sh

Source. Another solution.

#!/bin/sh
# Unmute
/usr/bin/osascript -e 'set volume without output muted'
#!/bin/sh
# Mute audio
/usr/bin/osascript -e 'set volume with output muted'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment