Posted on 09-01-2016 08:10 AM
I have a profile set to use Message as the screen saver. Dose anyone know how to set the message for the screen saver via script?
Thanks
Solved! Go to Solution.
Posted on 09-01-2016 09:05 AM
I just put this together quickly, but haven't tested it. should work... Might need a logout/login before the text is picked up by the screensaver.
#!/bin/sh
#Todd Houle
#1Sept2016
ssTEXT="Meat is Murder"
UUID=$(/usr/sbin/system_profiler SPHardwareDataType | awk '/UUID/ { print $3; }')
LocalHomes=$(/usr/bin/dscl . -list /Users NFSHomeDirectory | grep -v /var/ | grep -v /Library/ | awk '$2 ~ /^// {print $2;}')
## FEU
for OneHome in $LocalHomes; do
defaults write $OneHome/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist MESSAGE "$ssTEXT"
owner=$(ls -l $OneHome/Library/Preferences |grep ByHost|awk '/ByHost/{print $3}')
chown $owner $OneHome/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist
done
## FUT
defaults write /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist MESSAGE "$ssTEXT"
## Fix user template
/usr/sbin/chown root /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist
/bin/chmod 700 /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist
Posted on 09-01-2016 09:05 AM
I just put this together quickly, but haven't tested it. should work... Might need a logout/login before the text is picked up by the screensaver.
#!/bin/sh
#Todd Houle
#1Sept2016
ssTEXT="Meat is Murder"
UUID=$(/usr/sbin/system_profiler SPHardwareDataType | awk '/UUID/ { print $3; }')
LocalHomes=$(/usr/bin/dscl . -list /Users NFSHomeDirectory | grep -v /var/ | grep -v /Library/ | awk '$2 ~ /^// {print $2;}')
## FEU
for OneHome in $LocalHomes; do
defaults write $OneHome/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist MESSAGE "$ssTEXT"
owner=$(ls -l $OneHome/Library/Preferences |grep ByHost|awk '/ByHost/{print $3}')
chown $owner $OneHome/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist
done
## FUT
defaults write /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist MESSAGE "$ssTEXT"
## Fix user template
/usr/sbin/chown root /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist
/bin/chmod 700 /System/Library/User Template/English.lproj/Library/Preferences/ByHost/com.apple.ScreenSaver.Basic.$UUID.plist
Posted on 09-01-2016 09:54 AM
Posted on 11-27-2017 06:14 AM
The scrip works great. Thank you. To change the settings immediately and not have to powercycle or logout/login, just add the following to the end:
killall cfprefsd
Works great for me.
Posted on 09-25-2022 10:14 AM
@thoule is it working for Monterey?