Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

disable start up sound

On Leopard I could simply put down the volume before a shut down, and I had no anoying start up sound.However this seems not to work anymore on Lion.Which possibilities do I have to start my system without the roaring bong?

iMac, Mac OS X (10.7), respond to maximilianewert@yahoo.fr

Posted on Jul 24, 2011 8:49 PM

Reply
171 replies

Jul 28, 2011 1:01 AM in response to maximilian Jehuda Izchak

I've found another solution how to disable the startup sound. It also works on Lion - at least for me.

There is some terminal stuff to do, but it's worth it imo ;-)


Ok here we go:


1. Login as administrator and open a terminal window


2. Create scriptfile for muting

sudo nano /path/to/mute-on.sh


3. Enter this as content, when done press control+O to save and control+X to exit:

#!/bin/bash

osascript -e 'set volume with output muted'


4. Create scriptfile for unmuting

sudo nano /path/to/mute-off.sh


5. Enter this as content, when done press control+O to save and control+X to exit:

#!/bin/bash

osascript -e 'set volume without output muted'


6. Make both files executable:

sudo chmod u+x /path/to/mute-on.sh

sudo chmod u+x /path/to/mute-off.sh


7. Check if any hooks already exist (these will be overwritten, so make sure it is OK for you)

sudo defaults read com.apple.loginwindow LoginHook

sudo defaults read com.apple.loginwindow LogoutHook


8. Add hooks for muting

sudo defaults write com.apple.loginwindow LogoutHook /path/to/mute-on.sh

sudo defaults write com.apple.loginwindow LoginHook /path/to/mute-off.sh


Notes:

- /path/to/ is the location of the scripts, I used /Library/Scripts/

- you can skip the unmuting loginhook (i.e. each logout will silence your machine), but I like it this way because I always have sound available exactly at the volume level I set last time

- root has to be the owner of the script files - running an editor from command line with sudo is the easiest way to achieve that (otherwise you need to chown)

- to delete the hooks, use the following:

sudo defaults delete com.apple.loginwindow LoginHook

sudo defaults delete com.apple.loginwindow LogoutHook

Jul 28, 2011 2:32 PM in response to Acid

Thanks, Acid. This method works reliably on my system, and it gave me the clues to develop my own method.


What I finally settled on is simple and visible. I simply added a line to my AppleScript which is run at each login to set the internal speakers volume to 50% so I can hear the startup sound at lower than full volume the next time I reboot. Not ideal (should actually be run at logout) but good enough for me. The added line is:


do shell script "osascript -e 'set volume output volume 50'" password "password" with administrator privileges

I think "with administrator privileges" is necessary so the internal speakers volume is set rather than the line out volume (my chosen output device), hence the use of a shell script. My knowledge of AppleScript is not great, so there may be a better way to do the same thing.

Aug 1, 2011 3:00 AM in response to mr_urf

Hmm, my iMac doesn't seem to differentiate between the internal speakers and the headphone port. Is this something specific to the iMac? Or to Lion? New to both 🙂



UPDATE:


For reference:


headphones in http://d.pr/tEP

headphones out http://d.pr/8Poh

USB headphones in instead http://d.pr/BJ8L


The startup sound only plays now if I have anything plugged into the headphone port. My USB headphones work fine.





System: iMac 27" early 2011, 3.4 GHz i7, 8GB RAM, 256 SSD, 2TB HDD, 6970M 2GB

OS: 10.7


Message was edited by: mr_urf

Aug 3, 2011 11:10 AM in response to mr_urf

@mr_urf


I just recognized that the mute script doesn't work to 100% if you have an USB headset plugged into your Mac. The problem is that the USB headset is muted when logging out and not the internal speakers. That's why you can hear the startup sound the next time you start up your Mac.


I was trying to get the script working but it doesn't seem to be that easy 😟

The only proper way to get this working is an AppleScript. However it's not a nice way imo, but it works 🙂


I'll post the contents of my AppleScript here. It looks like that:

------------------------------------------------------------

tell application "System Preferences"

activate

set current pane to pane "com.apple.preference.sound"

end tell


tell application "System Events"

tell application process "System Preferences"

tell tab group 1 of window "Sound"

click radio button "Output"

set selected of row 1 of table 1 of scroll area 1 to true

set deviceselected to "Internal Speakers"

delay 2

end tell


set muteState to value of checkbox "Mute" of window "Sound"


if muteState is 0 then

click checkbox "Mute" of window "Sound"

end if

end tell

end tell


tell application "System Preferences" to quit

-----------------------------------------------------------


Just use the AppleScript editor to save the script at /Library/Scripts/mute.scpt for example.

Then you have to call it in the "mute-on.sh" script like as follows:

osascript /Library/Scipts/mute.scpt

disable start up sound

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.