My Opera is closing 3rd of March

glob

mereh's mobile photo blog from Berlin / Germany

Apple OSX: Mute startup sound / 'chime' in OSX 10.7 Lion and others

, , , ,

Acid got a working solution for OSX Lion which disables the startup sound without affecting your sound volume after logging in again. This was posted as a comment at the official Apple Forum originally. Thanks to Acid for this!

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

Apple OSX: Upgrade from Snow Leopard to Lion for freeApple OSX: How to fix truecrypt crashing on 64 bit Snow Leo / Lion

Comments

Unregistered user Tuesday, August 2, 2011 7:11:00 PM

SFY writes: Hi Merlin! Du warst die #3 in meinem Google-Suchergebnis! LG, Steph--

Unregistered user Sunday, August 7, 2011 8:00:24 AM

philippe writes: Hi, Thanks a lot, It works perfectly on 10.7 iMac and MacBook Pro. Regards

mereh Monday, August 8, 2011 9:46:47 AM

you are welcome wink

Unregistered user Wednesday, August 10, 2011 10:25:56 AM

yjune writes: Thank you so much. I wanna turn up my Mac with silence. But after this update (Lion), it's always make sound. So I'm so nervous when I go to library, but now it's OK and work very good. Thank you once more. -From Korean Mac user-

Unregistered user Friday, August 12, 2011 6:08:05 PM

Nina_bm writes: Hey! I followed the instructions precisely (Lion) and it didn't work! I changed the order and tried some other ways and in the end I deleted the LoginHook: sudo defaults delete com.apple.loginwindow LoginHook It works perfectly now and I even have sound since the very beginning! (:

mereh Saturday, August 13, 2011 9:06:28 PM

Originally posted by anonymous:

/path/to/



Did you replace "/path/to/" with an existing folder? This could be the problem if it didn't work ..

Unregistered user Wednesday, August 17, 2011 3:16:12 PM

Anonymous writes: AHH... At last, a solution that works (so far)! It's a shame that you have to go through all this on a Mac (not to mention all the tools from acrana and several others) just to mute the annoying startup sound.

Unregistered user Thursday, August 18, 2011 11:17:07 PM

Anonymous writes: Nice!!! you use be the first, here's another i like kiosk mode from the app docker, to autohide menubar

Unregistered user Sunday, August 21, 2011 5:00:06 AM

xxsoo writes: Oh!! Thank you.

Unregistered user Monday, August 22, 2011 2:15:04 PM

Anonym writes: Thank you so much for the instructions! My system would always startup on mute after installing Lion, so I had to unmute every time I started my computer. Using only the 'mute-off'-bit of your tutorial, I could finally fix the problem! Thanks a lot!

Unregistered user Thursday, September 1, 2011 12:37:20 PM

Anonyme writes: Thanks !! It works great.

Unregistered user Sunday, September 11, 2011 2:32:52 PM

Anonyme writes:

Unregistered user Sunday, September 11, 2011 2:33:07 PM

Anonyme writes:

Unregistered user Sunday, September 11, 2011 2:33:21 PM

Anonyme writes:

Unregistered user Tuesday, September 13, 2011 4:27:16 PM

Anonymous writes: Nice! Thanks, works great!

Unregistered user Monday, September 19, 2011 10:17:20 PM

Anonymous writes: when i type control+O to save it, i press enter and i get "[ Error writing /path/to/mute-on.sh: No such file or directory ]" can you help me fix this? thanks

mereh Monday, September 19, 2011 10:32:15 PM

"/path/to/" is a placeholder. You must replace it with an existing folder. I use a folder inside my home folder which contains several scripts. You can create a folder in Finder or with "mkdir YourFolder" in the Terminal. This example would create a folder named YourFolder inside the root of your home folder.

Unregistered user Sunday, October 2, 2011 9:05:36 AM

Some Dude writes: I've gone through these steps about 15x on two Macs but can't get any results. My /path/to situation is set to /Library/Scripts/. I'm hitting ctrl + o to write out, pressing Return, then ctrl + x I've checked that the hooks are actually there after creating them and can't find any issues when I troubleshoot. It looks like it should work just fine. I tried replacing the apostrophes with quotes as suggested on a comment to these instructions on another website (e.g., "set volume with output muted") - but that didn't help anything. Why is this working for everyone but me?? (Lion 10.7.1)

Unregistered user Tuesday, October 4, 2011 3:39:40 AM

Dennis writes: Would someone please put these instructions into really easy-peasy layman's terms? I've done a bit of poking around in my new MBA and copied some scripts into Terminal a few times before on my iBook but the window that opens after the "sudo nano /path/to/mute-on.sh" entry is all new to me (i.e. scary because I'm worried about what damage I can do in this deeper level of operations) and I don't know what is meant by 'hooks', 'chown' , checking if hooks exist, etc. but I really want to know how to be free of that fracking annoying start-up chime.

Unregistered user Tuesday, October 4, 2011 3:40:26 AM

Dennis writes: Would someone please put these instructions into really easy-peasy layman's terms? I've done a bit of poking around in my new MBA and copied some scripts into Terminal a few times before on my iBook but the window that opens after the "sudo nano /path/to/mute-on.sh" entry is all new to me (i.e. scary because I'm worried about what damage I can do in this deeper level of operations) and I don't know what is meant by 'hooks', 'chown' , checking if hooks exist, etc. but I really want to know how to be free of that fracking annoying start-up chime.

Unregistered user Tuesday, October 4, 2011 3:45:56 AM

Dennis writes: Oops. Sorry for saying that twice. Didn't appear after my first try so I resubmitted it.

mereh Tuesday, October 4, 2011 8:41:50 AM

@some Dude: Maybe you didn't set the appropriate access rights? mine are:

-rwxr-xr-x
owner: root
group: wheel

you can check this in terminal with "ls -la" without quotes.
You must create these files as root (with sudo).

mereh Tuesday, October 4, 2011 8:51:31 AM

@Dennis: Maybe you know somebody who has used the terminal before who can help you with this? You really need some basic knowledge, otherwise you can break your Mac while working as super-user (which you do when executing something with the prefix "sudo"). And you need to read the instructions very careful. There it is written that you must replace "/path/to" with an existing folder on your mac. You can create a folder "mute" in your home folder (not Documents) in Finder and then replace the "/path/to" with "/Users/YourUserName/mute". All without quotes and replace "YourUserName" with your user name. If you don't know your user name execute "whoami" in terminal.

Unregistered user Tuesday, October 4, 2011 11:55:21 AM

Dennis writes: @Mereh Thanks...I'll ask around. Unfortunately, in my circle I'm the one everyone comes to when they're having computer problems! I think the '/path/to/' part was the thing that was throwing me most- and I wanted to be very sure about it before entering that bit as a command-and the appearance of a new box I'd never seen before (despite having used Terminal to enter code I've copied from forums before) after entering 'sudo nano /path/to/mute-on.sh'. Next on my list is finding out how to get around the region coding on these new MBAs & their super drives.

Unregistered user Wednesday, October 5, 2011 3:03:51 PM

Anonymous writes: - 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) How do I do this?????? please give the code to paste in Terminal

Unregistered user Friday, October 7, 2011 6:30:47 AM

Anonymous writes: Thanks, this works. You must also make sure that the parent folder has the same permissions that Pereh outlined above, otherwise it won't work.

Unregistered user Thursday, October 13, 2011 11:38:33 PM

Some Dude Replying writes: Mereh, could you write out the sudo commands you are describing as they would be entered in Terminal? I'm only comfortable working in Terminal with a good set of instructions. Sorry for the late response. Thanks for the help! I checked "ls -la" and saw a bunch of permissions but didn't really know what I was looking at or how to proceed. ***************************** -rwxr-xr-x owner: root group: wheel you can check this in terminal with "ls -la" without quotes. You must create these files as root (with sudo).

Unregistered user Friday, October 14, 2011 4:46:08 AM

Anonymous writes: sudo chown root:wheel /path/to/your/script/this/can/be/anywhere.sh

Unregistered user Saturday, October 15, 2011 2:31:56 AM

Some Dude writes: I followed the instructions above to the letter and did create the files with sudo, so I'm not sure why my permissions would be wrong. - But I did run "sudo chown root:wheel /Library/Scripts/mute-on.sh" and the same thing for "mute-off.sh" as suggested, and then re-added the hooks for muting (step 8), but still nothing. Did I execute those correctly? Any more ideas? :/

Unregistered user Tuesday, October 18, 2011 8:41:04 AM

Dennis writes: Hi again, Mereh. Sorry to bother you with this. I think I've followed the instructions correctly but I can't get past step 6. I placed a folder called 'mute' in my user folder so the path to that folder was /Users/MyName/mute I followed steps 1-5. When I entered "Control+X" to exit at steps 3 & 5 I heard an error beep so I had to close terminal to get back in again to follow the next step. When I checked the scripts that were written to the 'mute' folder using TextEdit I found their content was the same as the content entered at steps 3 & 5: "#!/bin/bash osascript -e 'set volume with output muted'" & "#!/bin/bash osascript -e 'set volume without output muted'" but the files were named "mute-on.sh.save" and "mute-off.sh.save". When I tried to do step 6 Terminal said "No such file or directory", I assume because of the ".save" prefixes. Do you have any advice? Cheers, Dennis

Unregistered user Tuesday, October 18, 2011 8:46:18 AM

Anonymous writes: P.S. You say "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". Does this mean that if I always want my Mac to start silently I shouldn't enter any of the "mute-off" instructions? Cheers, Dennis

mereh Wednesday, October 19, 2011 9:17:25 AM

Hi Dennis..Steps 3&5, edit save: did you enter ctrl+x or cmd+x? its important that you use "ctrl".
"you can skip the unmuting loginhook" means that your mac will be always muted when you start up, anyway what level the volume was set when you logged out. Yes you can ignore the mute-off stuff if that is OK for you.

Unregistered user Thursday, October 20, 2011 3:44:18 AM

Dennis writes: Hi Mereh Thanks for getting back to me on this. I'm definitely using 'CTRL+X'. Happy to report that I got it to work by deleting '.save' from the file's prefix so it would be recognised by Terminal when I went through steps 6, 7 & 8. :)

Unregistered user Thursday, October 20, 2011 3:53:39 AM

Dennis writes: D'oh! I said 'prefix' in my last post and in one before that when I should have said 'suffix'. So...the file was being created with the name 'mute-on.sh.save' but when I removed the '.save' suffix Terminal could recognise it when going through steps 6, 7 & 8.

mereh Thursday, October 20, 2011 7:45:20 AM

You also need to confirm with 'y' after pressing ctrl+x when saving an existing file..

Unregistered user Thursday, October 20, 2011 11:26:11 AM

Dennis writes: Ah, so maybe if I'd confirmed with 'y' the '.save' suffix would have been unappended or wouldn't have been added in the first place and I could have proceeded with steps 6-8. Still, it's working now. Thanks a lot for this information & for helping answer my questions, Mereh. I'm keeping a copy to keep a copy of this webpage for reference.

Unregistered user Thursday, October 20, 2011 11:27:56 AM

Dennis writes: D'oh! Last line should read "I'm keeping a copy of this webpage for reference"

Unregistered user Friday, October 21, 2011 6:14:09 AM

Anonymous writes: I found a good reference for noobs like me. http://ss64.com/osx/

Unregistered user Friday, October 21, 2011 8:08:54 AM

fuzzi writes: gone through step by step but didn't work on my mbp late 08. i've done a clean lion install. wondering because files own to root are executable and are correctly in login/out hooks...

Unregistered user Friday, October 21, 2011 8:12:02 AM

fuzzi writes: maybe because i installed startupsound.prefpane but i uninstalled it with rightklick in systempref. was that wrong?

mereh Sunday, October 23, 2011 6:40:02 PM

When I installed startupsound.prefpane on Lion it had no effect..anyway I could successfully mute it later with the instructions above..
You can test the scripts by just executing them without hooks. This could help you to find the problem.

sh mute-on.sh
or
./mute-on.sh

Inside the folder where you placed the scripts. Your sound should be muted after.

Unregistered user Sunday, November 6, 2011 8:18:44 PM

Anonymous writes: Can you please post this on youtube. I'm such nube and I can't understand what the hell those instructions are saying.... Sorry Please post it on the youtube so some of people like me big time nube can just watch and follow. thank you!

Unregistered user Monday, November 7, 2011 10:53:51 PM

Dennis writes: Hi again, Mereh. Thought you might be interested to know that on two occasions since installing the mute-on scripts I've heard the start up sound when starting the computer. First time I went through all the instructions again and reinstalled the script. Second time I noticed that Powerpoint and Word were open on starting up (because they were open at shutdown) so I tried to duplicate the result but it didn't work. That was a week ago. Haven't heard it since. Any ideas why it wouldn't always work? Cheers, Dennis

mereh Wednesday, November 9, 2011 9:30:50 AM

For me it works very well. I am also using Word & Powerpoint (2011) almost every day. Do you use multiple user accounts on your Mac? Maybe thats the problem..? Just an idea.. Or maybe there are other "hooks" that cause conflict?

@Anonymous user asking for youtube..anybody here who can do this? wink

Unregistered user Monday, November 21, 2011 9:26:11 PM

Mikhail writes: Worked great on MacBook Air OSX 10.7

Unregistered user Sunday, November 27, 2011 12:02:33 AM

bb writes: Worked on Macbook Pro OSX 10.7! Thanks!

Unregistered user Tuesday, November 29, 2011 11:10:05 AM

Eric Stone writes: mereh, Acid First, thanks for this. It's not exactly what I was working on, but it's close enough that I got it done quickly! Everyone who is still lost - would it help if I created a script to do everything for you and a single line of code to copy/paste into the terminal to run it? If so, drop by and let me know at StoneAgeMods.wordpress.com

Unregistered user Monday, December 5, 2011 11:30:20 PM

Anonymous writes: thank you!

Unregistered user Friday, December 16, 2011 9:13:12 PM

AJ writes: Thanks, works great. Didn't work initially because you have to use abolute pathname to add the hooks (in my case /Users/home/aj/scripts/mute-on.sh, not just mute-on.sh), I tried relative pathnames, that did not work. :)

Unregistered user Monday, December 19, 2011 10:35:34 PM

Anonym writes: Danke!

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28