Hi all,
I was having trouble finding a solid solution/script to set the screensaver timeout universally. This is the script I came up with to make it happen. Let me know if you have any feedback. And, of course, this comes with out warranty and don't hold it against me if your machine blows up but I have tested it with 10.5-10.7. Hope it helps someone out there.
#!/bin/sh
######################################################################################
# Sets Screen Saver Timeout for all users to passed variable from Casper.
# Brad Schmidt February 28, 2012
#################################################
# List the preference files for existing Users
preffiles=`ls /Users/*/Library/Preferences/ByHost/com.apple.screens* | grep -v lockfile | rev | cut -c7-1000 | rev`
# Modify each preference file and reset permissions back to original owner
for item in $preffiles ; do defaults write $item idleTime $4; chown `echo $item | cut -f3 -d '/'` $item".plist" ; done
# Copy complete preference files to the User Template - disttech is a user that is on all of our machines, change it to suit your environment
cp /Users/disttech/Library/Preferences/ByHost/com.apple.screensaver* /System/Library/User Template/English.lproj/Library/Preferences/ByHost/
# Set Permissions on those preference files in User Template
chown root:wheel /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.screensaver*
chmod 700 /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.screensaver*
exit 0
Thanks!
Brad
