èµ·åé³ã¸ã£ã¼ã³ã®é³éãèªå¨ã«ã³ã³ããã¼ã«ãããï¼
MacBook Pro Retinaã«ç§»è¡ãã¦ãããèµ·åé³ããããããªã£ã¦ãã¾ã£ããMacBook OSX10.6.8ã¾ã§ã®ç°å¢ã§ã¯ãStartupSound.prefPaneãç´ æ´ãããã£ã¦ãããã¸ããä¸è©±ã«ãªã£ã¦ãããã¨ããããOSX Lion以éã®ç°å¢ã«ã¯æ®å¿µãªãã対å¿ãã¦ããªã...ãå°ã£ã¦ããã*1
èµ·åé³ãæ¶é³ããæ
- 調ã¹ã¦ã¿ãã¨ãèµ·åé³ãæ¶é³ããæãå ¬éããã¦ããã
- disable start up sound: Apple Support Communities
sudo defaults read com.apple.loginwindow
- äºåã«ä¸è¨ã³ãã³ãã§com.apple.loginwindowããã¯ãå©ç¨ããã¦ããªããã¨ã確èªãã¦ããã
2012-12-18 04:53:04.603 defaults[6963:a07] Domain /var/root/Library/Preferences/com.apple.loginwindow does not exist
- 確èªã§ãããã以ä¸ã®ã·ã§ã«ã¹ã¯ãªããã§ç¬èªã®ããã¯ãè¨å®ããã®ã ãï¼ã³ãã¼ï¼ãã¼ã¹ãã§OKï¼
sudo sh -c "cat <<EOS > /Library/Scripts/mute-on.sh #!/bin/bash osascript -e 'set volume with output muted' EOS " sudo sh -c "cat <<EOS > /Library/Scripts/mute-off.sh #!/bin/bash osascript -e 'set volume without output muted' EOS " sudo chmod u+x /Library/Scripts/mute-on.sh sudo chmod u+x /Library/Scripts/mute-off.sh sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/mute-on.sh sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/mute-off.sh
- ããã¯ã解é¤ããå ´åã¯ã以ä¸ã®ã³ãã³ããå®è¡ããã
sudo defaults delete com.apple.loginwindow LoginHook sudo defaults delete com.apple.loginwindow LogoutHook sudo rm /Library/Scripts/mute-on.sh sudo rm /Library/Scripts/mute-off.sh
- OSXã«ã¯ãã°ã¤ã³æããã°ã¢ã¦ãæã«ã¹ã¯ãªãããå®è¡ããä»çµã¿ãç¨æããã¦ããã
- ãã®ä»çµã¿ãå©ç¨ãã¦ããã°ã¢ã¦ãã§æ¶é³ãã¦ããã°ã¤ã³ã§æ¶é³ã解é¤ãã¦ããã®ã ã
- ä¸è¨ã®ä»çµã¿ããã®ã¾ã¾å©ç¨ãã¦ããã¨æãããStartNinjaã¨ããã¢ããªã±ã¼ã·ã§ã³ããã£ãï¼
ã¨ããã§ãèµ·åé³ã¯åãªã飾ãã§ã¯ãªããé»æºæå
¥å¾ã®POSTã¨å¼ã°ããèªå·±è¨ºæãã¹ãï¼ãã¼ãã¦ã§ã¢ã®åæåãã¡ã¢ãªãã¹ãï¼ã«åæ ¼ãããã¨ãæå³ãã¦ããã
ä»®ã«MacBookãæ£å¸¸ã«èµ·åããªãç¶æ ã«é¥ã£ãæããã¸ã£ã¼ã³ããé³´ã£ã¦ããã°èªå·±è¨ºæãã¹ãã¾ã§ã¯åé¡ãªããã¨ã確èªã§ãããé³´ããªãæã¯ãã¼ãé³ã«ãã£ã¦ãã¨ã©ã¼ã®å 容ãä¼ãã¦ããããï¼ç¨ã«ã¡ã¢ãªã®åãä»ãä¸è¯ãªã©ã§ãã¸ã£ã¼ã³ããé³´ããªããã¨ãªã©ãããï¼ã¤ã¾ããã¸ã£ã¼ã³ãã¯ãã¼ãã¦ã§ã¢ã«åé¡ããªããã¨ããéè¦ãªãã£ã¼ãããã¯ãªã®ã§ãããï¼é³´ã£ã¦å½ç¶ãªã®ã ãã©ï¼ã ãããæ¶é³ã«ãã¦ãã¾ããã¨ã«ã¯è¥å¹²æµæãããã®ã ã
主é³éã¨èµ·åé³ã®é¢ä¿
- ä»ã¾ã§StartupSound.prefPaneã«é ¼ã£ã¦ããã®ã§ç¡é çã«ãªã£ã¦ããããèµ·åé³ã®é³éã¯ã·ã¹ãã çµäºæã®ä¸»é³éã¨é£åãã¦ããã
- 主é³éãå°ãããã°èµ·åé³ãå°ãããªãã主é³éã大ããã¨èµ·åé³ã大ãããªããï¼MacBook Pro Retina OSX 10.8.2ã®ç°å¢ã«ããã¦ï¼
- ãªãã°ãæ¶é³ã®ã·ã§ã«ã¹ã¯ãªãããè¥å¹²å¤æ´ãã¦ãå°ããªé³éãè¨å®ããã¹ã¯ãªããã«ãã¦ãã¾ãããããªã·ã§ã«ã¹ã¯ãªãããä½ã£ã¦ã¿ãã
- ãã°ã¢ã¦ãã®æãç¾å¨ã®ä¸»é³éãä¿åãã¦ã好ã¿ã®å°ããªé³éã«ãã¦ããã
- ãã°ã¤ã³ã®æã¯ãä¸è¨ã§ä¿åãã主é³éã«æ»ãã
sudo sh -c "cat <<EOS > /Library/Scripts/mute-on.sh #!/bin/bash osascript -e \"(get volume settings)'s output volume\" > /Library/Preferences/com.bebekoubou.StartupVolume.txt osascript -e \"set volume 7/16/100\" EOS " sudo sh -c 'cat <<-EOS > /Library/Scripts/mute-off.sh #!/bin/bash osascript -e "set volume 7*\`cat /Library/Preferences/com.bebekoubou.StartupVolume.txt\`/100" EOS ' sudo chmod u+x /Library/Scripts/mute-on.sh sudo chmod u+x /Library/Scripts/mute-off.sh sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/mute-on.sh sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/mute-off.sh
- ãããããæã¯ãããªã¥ã¼ã ã®åä½ãï¼ã¤ãããã¨ã
- AppleScriptã®(get volume settings)'s output volumeã§ã¯ã0-100ã®é³éã¨ãã¦è¿ãããã
- AppleScriptã®set volume Xã§è¨å®ããã¨ãã®Xã¯ã0-7ã®é³éã¨ãã¦è¨å®ããã
- ã·ã¹ãã ç°å¢è¨å®ãããªã¥ã¼ã ãã¼ã§è¨å®ããæã¯ã0-16ã®é³éã¨ãã¦è¨å®ããã
- 以ä¸ã®ãã¨ãèæ
®ããã¨ã以ä¸ã®ãããªè¨ç®å¼ãå°ãããã
- set volume 7/16ã§ãããªã¥ã¼ã ãã¼ã®1ç®çãã®é³éã«ãªãã
- (get volume settings)'s output volumeã§25ãåå¾ããå ´åã
- set volume 7*25/100ã§ãå ã©ããã®é³éã«ãªãã
以ä¸ã®ã·ã§ã«ã¹ã¯ãªãããå®è¡ãã¦ããã¨ãèµ·åé³ã¸ã£ã¼ã³ã¯ãããå°ããªããããã®é³éã«ã³ã³ããã¼ã«ãããï¼
ããããã©ã³ã®åé¡
- ã§ããï¼ã¨åãã ã®ãæã®éãããã«åé¡ãçºè¦ãã...ã
- ããããã©ã³ãå·®ãè¾¼ã¾ããã¾ã¾ã§ã¯ç大ã«ãã¸ã£ã¼ã³ã
- ããããã©ã³ãå·®ãè¾¼ãã§ããªããã°å°ããªé³éã«ã³ã³ããã¼ã«ãããã
- ã»ã¨ãã©ããããã©ã³ãå·®ãè¾¼ããã¨ã¯ãªãã®ã§ã¾ãããããã¨ã¹ã«ã¼ãããã¨æã£ããã
- ããããèããã°ãå¤åºå ã§ããããããã©ã³ããã¦ä½¿ããããããªãã
- ããããã©ã³ããé³ãåºãã ããã¨æ³åãã¦åèµ·åããã¨ãæ¥ããããæãããã¦ãã¾ãã
ããããã©ã³ã®é³éãã³ã³ããã¼ã«ãã¦ããããï¼
nvramãå©ç¨ããèµ·åé³ã®ã³ã³ããã¼ã«
- èµ·åé³ãã³ã³ããã¼ã«ããã«ã¯ããã1ã¤ã®æ¹æ³ãããã
- nvramã³ãã³ãã§SystemAudioVolumeãè¨å®ããã®ã ã
sudo nvram SystemAudioVolume=%80
- 以ä¸ã®è¨å®ãããç¶æ ã§åèµ·åããã¨ãèµ·åé³ãæ¶é³ãããã
- ...ã¯ããªã®ã ããã©ããMacBook Pro Retina OSX 10.8.2ã®ç°å¢ã§ã¯ãæ¶é³ããããããããªãã£ããã¨å®å®ããªããæ°ã¾ããã§ãã...ã
- ã¡ãªã¿ã«å代MacBook OSX 10.6.8ã®ç°å¢ã§è©¦ãã¨ã常ã«æ¶é³ãããï¼ã©ãããããã¼ãã¦ã§ã¢ã®ä»æ§ãå¤æ´ããã¦ããã®ãããããªãã
- å®ã¯ãæåã¯nvramãè¨å®ããæ¹æ³ã§ãæ軽ã«ã§ããªããã¨è©¦è¡é¯èª¤ããã®ã ãã©ã確å®ã«è¨å®ã§ããæ¹æ³ãè¦ã¤ããããªãã¦è«¦ãã¦ããã
- ãã®ä»£ãããä½åº¦ã試è¡é¯èª¤ããä¸ã§ã·ã¹ãã ã®ä¸»é³éã¯ã·ã¹ãã çµäºæã«nvramã«æ¸ãè¾¼ã¾ãã¦ãããã¨ããã¹ãã¼ãªã¼ãæ³åã§ããã
- nvramã³ãã³ãã§è¨å®ãã¦ããã·ã¹ãã çµäºæã«OSå´ã§æ¸ãæãã¦ãã¾ããããnvramã®è¨å®ããã¾ãåæ ãããªãã®ãããããªãã¨ã
- ãããè£ä»ããç¾è±¡ã¨ãã¦ãã·ã¹ãã èµ·åå¾ã«nvram SystemAudioVolumeãå®è¡ããã¨ã%80ã§ã¯ãªãå¤ãåºåããã¦ãã¾ãã®ã ...ã
$ nvram SystemAudioVolume
SystemAudioVolume :
- ç¨ã«éè¯ãèµ·åé³ãæ¶é³ãããæã¯ãã·ã¹ãã èµ·åå¾ã®SystemAudioVolumeã¯ãã¡ããã¨%80ã«è¨å®ããã¦ããã
- ã¾ããã·ã¹ãã èµ·åå¾ã®SystemAudioVolumeã®å¤ã¯ã主é³éã®ããªã¥ã¼ã å¤ã¨é£åãã¦ãããã¨ã«ãæ°ä»ããã
- ããã«è©¦è¡é¯èª¤ãç¶ãã¦ããã¨ãç¨ã«éè¯ãèµ·åé³ãæ¶é³ãããæ¡ä»¶ãã¨ããã®ãåãã£ã¦ããã
- ã©ãããããããã©ã³ãæ¥ç¶ããç¶æ ã§åèµ·åããã¨ãèµ·åé³ãæ¶é³ããããã¨ãå¤ãã®ã ã
ãããããããnvramã®è¨å®ã¯ããããã©ã³ã«æå¹ãªã®ãããããªãï¼ãããªæå¾
ãããªãã試ãã¦ç解ãããã¨ã
- nvramã«ããè¨å®ã¯ãå èµã¹ãã¼ã«ã¼ã«ã¯ç¡å¹ã§ããã
- nvramã«ããè¨å®ã¯ãããããã©ã³ã«ã¯æå¹ã§ããï¼
- ãã ããããããã©ã³ãå·®ãæ¿ãå¾ã®ååã®åèµ·åã¯ãé³éãå¶å¾¡ãããªãã
- 2åç®ä»¥éã®åèµ·åã¯ãé³éãå¶å¾¡ãããã
- ã¾ãããã¨ãååã®åèµ·åã§ãã£ã¦ããä¸æ¦ãã°ã¢ã¦ããã¦ããåèµ·åããã¨ãé³éãå¶å¾¡ãããã
- 以ä¸ã®ãã¨ãç解ãã¦ããã°ã¢ã¦ãããã¯ã®ä¸ã§nvramã®è¨å®ããã¦ã¿ããã¨æãä»ããã
- set volumeã¨nvramã³ãã³ãã®åããæã§ããã
- SystemAudioVolumeã®å¤ã¯ãset volumeã§è¨å®ããããªã¥ã¼ã å¤ã«é£åããå¤ã«è¨å®ãã¦ã¿ãã
ããã¨ãããããã©ã³ãå·®ãè¾¼ãã ç¶æ ã§ãèµ·åé³ãã³ã³ããã¼ã«ãããããã«ãªã£ãï¼
sudo sh -c "cat <<EOS > /Library/Scripts/mute-on.sh #!/bin/bash osascript -e \"(get volume settings)'s output volume\" > /Library/Preferences/com.bebekoubou.StartupVolume.txt osascript -e \"set volume 7/16/100\" nvram SystemAudioVolume=%03 EOS " sudo sh -c 'cat <<-EOS > /Library/Scripts/mute-off.sh #!/bin/bash osascript -e "set volume 7*\`cat /Library/Preferences/com.bebekoubou.StartupVolume.txt\`/100" EOS ' sudo chmod u+x /Library/Scripts/mute-on.sh sudo chmod u+x /Library/Scripts/mute-off.sh sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/mute-on.sh sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/mute-off.sh
- ãã ããããããã©ã³å·®ãæ¿ãå¾ã®ååã®åèµ·åã ãã¯ãä¸æ¦ãã°ã¢ã¦ãããªãéããèµ·åé³ã¯å¶éãªãé³´ã£ã¦ãã¾ã...ã
èµ·åé³ãã³ã³ããã¼ã«ããAppleScript
- ããããã©ã³ã®åé¡ã ãã¯ä¸é¨æ®ã£ã¦ãã¾ã£ããã以ä¸ã®ä»çµã¿ãAppleScriptã«ã¾ã¨ãã¦ãããã¨ã«ããã
-
-
- startup_volume_controller.scpt
- 以下コードをAppleScriptエディタで開く
-
property StartupVolume : ""
if StartupVolume_hook() â "" then
activate
"ãã§ã«ããã¯ãå©ç¨ããã¦ãã¾ãã
[ OK ]ã§ç¶ããã¨ã以ä¸ã®ããã¯ãç¡å¹ã«ãªãã¾ãã" & return & return & StartupVolume_hook() display dialog result with title "com.apple.loginwindowããã¯"
end if
set script_volumes to {"0", "7/16/100", "7/16/4", "7/16", ""} set nvram_volumes to {"%80", "%03", "%0e", "%1d", ""} set v to (get volume settings)'s output volume
repeat
activate
{"1. â¡â¡â¡â¡â¡â¡â¡â¡", "2. â â¡â¡â¡â¡â¡â¡â¡", "3. â â â¡â¡â¡â¡â¡â¡", "4. â â â â¡â¡â¡â¡â¡", "5. 調æ´ãªã"} set res to (choose from list result with title "é³éè¨å®" default items StartupVolume OK button name "è¨å®" cancel button name "éãã") if res's class is list then
set StartupVolume to res
set vol_str to script_volumes's item (res's item 1's item 1) set sys_str to nvram_volumes's item (res's item 1's item 1) else
exit repeat
end if
if vol_str = "" then
uninstall_hook() else
install_hook(vol_str, sys_str) end if
simulate_startup_sound(vol_str) activate
display dialog "èµ·åé³: " & (res as text)'s items 3 thru -1 buttons {"OK"} with icon 1 giving up after 3
end repeat
set volume 7 * v / 100
--LoginHook LogoutHookãã¢ã³ã¤ã³ã¹ãã¼ã«
on uninstall_hook() "
fpath=/Library/Preferences/com.bebekoubou.StartupVolume;
rm $fpath.txt;
rm $fpath.set_volume.sh;
rm $fpath.restore_volume.sh;
defaults delete com.apple.loginwindow LoginHook;
defaults delete com.apple.loginwindow LogoutHook;"
try
do shell script result with administrator privileges
end try
end uninstall_hook
--LoginHook LogoutHookãã¤ã³ã¹ãã¼ã«ãã
on install_hook(vol_str, sys_str) "
fpath=/Library/Preferences/com.bebekoubou.StartupVolume;
cat <<EOS > $fpath.set_volume.sh;
#!/bin/bash
osascript -e \"(get volume settings)'s output volume\" > $fpath.txt
osascript -e \"set volume " & vol_str & "\"
nvram SystemAudioVolume=" & sys_str & "
EOS
chmod u+x $fpath.set_volume.sh;
defaults write com.apple.loginwindow LogoutHook $fpath.set_volume.sh;
cat <<EOS > $fpath.restore_volume.sh;
#!/bin/bash
osascript -e \"set volume 7*\\`cat $fpath.txt\\`/100\"
EOS
chmod u+x $fpath.restore_volume.sh;
defaults write com.apple.loginwindow LoginHook $fpath.restore_volume.sh;"
do shell script result with administrator privileges
end install_hook
--è¨å®ããé³éã§èµ·åé³ãåçãã¦ã¿ã
on simulate_startup_sound(vol_str) set fpath to "/Applications/Mactracker.app/Contents/Resources/Chimes/PCI based Power Mac 2.m4a"
try
do shell script "test -e " & quoted form of fpath
do shell script "(
v=`osascript -e \"(get volume settings)'s output volume\"`;
osascript -e \"set volume " & vol_str & "\";
afplay " & quoted form of fpath & "
osascript -e \"set volume 7*$v/100\"
) >& /dev/null &"
on error
do shell script "(
v=`osascript -e \"(get volume settings)'s output volume\"`;
osascript -e \"set volume " & vol_str & "\";
afplay '/System/Library/Sounds/Sosumi.aiff'
osascript -e \"set volume 7*$v/100\"
) >& /dev/null &"
end try
end simulate_startup_sound
--com.apple.loginwindowããã¯ã®ç¶æ ãè¿ã
on StartupVolume_hook() activate
{"/Library/Preferences/com.bebekoubou.StartupVolume.restore_volume.sh", ¬ "/Library/Preferences/com.bebekoubou.StartupVolume.set_volume.sh"} set hook_paths to result
try
set LoginHook to ""
"defaults read com.apple.loginwindow LoginHook"
set LoginHook to do shell script result with administrator privileges
if LoginHook is in hook_paths then set LoginHook to ""
end try
try
set LogoutHook to ""
"defaults read com.apple.loginwindow LogoutHook"
set LogoutHook to do shell script result with administrator privileges
if LogoutHook is in hook_paths then set LogoutHook to ""
end try
if LoginHook & LogoutHook â "" then
"defaults read com.apple.loginwindow"
do shell script result with administrator privileges
else
""
end if
end StartupVolume_hook
- èµ·åããã¨ãã¾ã管çè ã®èªè¨¼ãå¿ è¦ã
- ãã§ã«StartNinjaãªã©ã®ããã¯ãå©ç¨ããã¢ããªã±ã¼ã·ã§ã³ãå©ç¨ãã¦ããå ´åã¯ã以ä¸ã®ãããªè¦åãåºãã
- ç¬èªã®ããã¯ãå©ç¨ãã¦ããæ¹ã¯ãããã¯ã¢ãããå¿ããã«ã
- [ OK ]ãæ¼ãã¨å¦çã¯ç¶è¡ãããããã¯ã®è¨å®ã¯ä¸æ¸ããããã
- ãããèµ·åé³ã®é³éãè¨å®ããã¦ã£ã³ãã¦ã ã
- è¨å®ããæã«ããã®é³éã§èµ·åé³ãé³´ãã®ã ï¼
-
- ãã ããèµ·åé³ãé³´ããã«ã¯Mactrackerã®ã¤ã³ã¹ãã¼ã«ãå¿ è¦ã
-
ãã£ã¨ã§ãããããã¾ã§ããã£ããä½åååèµ·åãããã¨ãã
*1:ã»ã¨ãã©æã¡åºããã¨ã¯ãªãã®ã ãã©ãå¤åºå ã§èµ·åããæãç大ã«ãã¸ã£ã¼ã³ããé³´ããã¦ãã¾ãã®ã¯æ ¼å¥½æªãã¨æã£ã¦ããããªãã ãMacBookãã¡ããã¨ã³ã³ããã¼ã«ã§ãã¦ããªã人ã¿ãããªã¤ã¡ã¼ã¸ãæ§ããã«ä»äººã«èãããããèãããªããã®ããå°ããªãã¸ã£ã¼ã³ãã§ä½¿ã£ã¦ããæ¹ã«åºä¼ãã¨ãä¸ç®ç½®ãã¦ãã¾ãã