M
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Control</key>
<true/>
<key>Mute</key>
<false/>
<key>Volume</key>
<real>1.6959167718887329</real>
</dict>
</plist>
sudo cat /Library/Scripts/chimebas.sh
sudo ls -al /Library/Scripts/chimebas.sh
sudo defaults read /private/var/root/Library/Preferences/com.apple.loginwindow.plist LogoutHook
#!/bin/bash
osascript -e 'set volume with output muted'
-rwxrwxrwx@ 1 root wheel 55 28 jui 17:04 /Library/Scripts/chimebas.sh
/Library/Scripts/chimebas.sh
set current_Vol to (do shell script "osascript -e \"output volume of (get volume settings)\"")
set votre_choix to button returned of (display dialog "Voulez-vous réduire le son au démarrage du Mac ?" buttons {"Oui", "Non", "Cancel"} default button 1)
if votre_choix is "Oui" then
do shell script "mkdir -p /usr/local/logouttask;echo '#!/bin/bash
# logout script
osascript -e \"set volume 1\"' > /usr/local/logouttask/logoutscript;sudo defaults write com.apple.loginwindow LogoutHook /usr/local/logouttask/logoutscript;chmod +x /usr/local/logouttask/logoutscript" with administrator privileges
do shell script "mkdir -p /usr/local/logintask;echo '#!/bin/bash
# login script
osascript -e \"set volume 4\"' > /usr/local/logintask/loginscript;sudo defaults write com.apple.loginwindow LoginHook /usr/local/logintask/loginscript;chmod +x /usr/local/logintask/loginscript" with administrator privileges
else
if votre_choix is "Non" then
try
do shell script "sudo defaults delete com.apple.loginwindow LogoutHook'';rm /usr/local/logouttask/logoutscript" with administrator privileges
do shell script "sudo defaults delete com.apple.loginwindow LoginHook'';rm /usr/local/logintask/loginscript" with administrator privileges
display dialog "Le volume du son au démarrage ne sera plus modifié." buttons {"OK"} default button 1
on error the error_message number the error_number
if error_number is 1 then
display dialog "Le son au démarrage ne sera pas modifié." buttons {"OK"} default button 1
else
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end if
end try
end if
end if