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
Page 1 / 1
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
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.
@thoule is it working for Monterey?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.