Deploying Screen Savers for Yosemite

Rudolph
New Contributor II

It seems screensaver settings are now contained within the ByHost files.

I have tried several scripts with mixed results and was wondering if anyone has had any luck with deploying a screensaver for an enterprise
What I am trying to achieve is point the screensaver to a folder with corporate pictures in it and change to the 'Classic' style.

7 REPLIES 7

nessts
Valued Contributor II

here it is in perl...as a log in script LaunchAgent that runs as the user logs in. we only set it once, could enforce it every login by getting rid of the unless test.

#!/usr/bin/perl -w
my $ss                  = $HOME . "/.screensaverset";
unless(-e $ss) {
        syslog('notice', "Setting default ScreenSaver");
        system("defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName "iLifeSlideshow" path "/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver" type 0");
        system("defaults -currentHost write com.apple.ScreenSaverPhotoChooser LastViewedPhotoPath """);
        system("defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath "/Library/Screen Savers/Default Collections/GreenSaver"");
        system("defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedSource -int 3");
        system("defaults -currentHost write com.apple.ScreenSaverPhotoChooser ShufflesPhotos -bool false");
        system("defaults -currentHost write com.apple.ScreenSaver.iLifeSlideShows styleKey KenBurns");
        system("touch "$ss"");
}

Araneta
New Contributor III

Hey @nessts ,

Do you know how to deploy a .saver on Yosemite as well?

Cheers.

nessts
Valued Contributor II

@Araneta I never could figure out how to make a saver to deploy it. but since it was just a bunch of pictures this was just as good.

set it the way you want it then read the files
defaults -currentHost read com.apple.screensaver
and see if any other files have been updated since you made your changes and see if they need changes made to them. start with a clean account its easier to find stuff.

Araneta
New Contributor III

Thanks @nessts , I just tried Composer and it worked for me. I just need to make sure to copy the contents to ~/library/Screen Saver and save it as dmg. 🙂

rstansifer
New Contributor III

@nessts I know this is a couple months old, but I'm trying to do pretty much the same thing as your script, but whenever I run it, the stylekey never changes. While the .plist will say the desired stylekey (In this case, Flipup), when I activate the screensaver, it's still at whatever it was set to previously directly through System Preferences.

I can't for the life of me figure out where it's storing this information.

Any suggestions?

(https://jamfnation.jamfsoftware.com/discussion.html?id=14453)

nessts
Valued Contributor II

try adding a killall cfprefsd at the end of your script perhaps?

rstansifer
New Contributor III

@nessts You sir, are a bucking genius. That was it. While System Preferences still shows the previously selected screen saver, the correct screensaver actually shows up, which is all I really care about. This has been driving me nuts in one way or another for months.

Thank you a dozen times over. ^^