2011/08/17 13:50
Lion을 포함한 Mac OS X에서 부팅음 끄기 Tip n Tech/Mac OS X2011/08/17 13:50
- Login as administrator and open a terminal window
- Create scriptfile for muting
- Enter this as content, when done press control+O to save and control+X to exit:
- Create scriptfile for unmuting
- Enter this as content, when done press control+O to save and control+X to exit:
- Make both files executable:
- Check if any hooks already exist (these will be overwritten, so make sure it is OK for you)
- Add hooks for muting
sudo nano /path/to/mute-on.sh
#!/bin/bash
osascript -e 'set volume with output muted'
sudo nano /path/to/mute-off.sh
#!/bin/bash
osascript -e 'set volume without output muted'
sudo chmod u+x /path/to/mute-on.sh
sudo chmod u+x /path/to/mute-off.sh
sudo defaults read com.apple.loginwindow LoginHook
sudo defaults read com.apple.loginwindow LogoutHook
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
