1

So I'm configuring some Default User Template LaunchAgents to configure a default screensaver for some of my company's most popular fan art. (It's actually been really well received by the team). They're designed as first-run images when they log into their forced-Local Active Directory users.

However, I'm getting very inconsistent results now...namely it's not working at all.

The .plist launches a Shell Script located in the /sbin/ folder. The odd thing is that it mostly works in an existing user.

The screensaver is meant to use "Flipup" with a specific folder of images, shuffle the pictures and set a start time of 5 minutes.

For example, I intentionally set my "default configuration user" screensaver first to the "Holiday Mobile," set the picture selection to "Cosmos" (one of the defaults) with a start time of 20 minutes and unchecked "shuffle images." Then I changed it to "Arabesque."

When I logged out and logged back in to kick in the script, the result was me getting "Holiday Mobile." However, when I went to "Desktop and Screensaver Settings," "Arabesque" was actually selected though the "Holiday Mobile" preview was showing with a grayed out "Screen Saver Options" below. (However, the start time did change to 5 minutes and when I did click on "Holiday Mobile," "Shuffle Slide Order" was checked properly.)

So in the test user, it's goes to Fan Art, activating Shuffle and changing the time.

But when I create a new user after adding the LaunchAgent .plist to the Default User Template, I get nothing but the standard "Computer Name" screensaver on a black background.

I am totally confused on why this is occurring. Any suggestions?

Here's the shell script:

```

#!/bin/sh

## Set Screensaver to Photo Slideshow
/usr/bin/defaults -currentHost write com.apple.screensaver 'CleanExit' -string "YES"
/usr/bin/defaults -currentHost write com.apple.screensaver 'PrefsVersion' -int "100"
/usr/bin/defaults -currentHost write com.apple.screensaver 'idleTime' -int "300"
/usr/bin/defaults -currentHost write com.apple.screensaver "moduleDict" -dict-add "path" -string "/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver"
/usr/bin/defaults -currentHost write com.apple.screensaver "moduleDict" -dict-add "type" -int "0" 
/usr/bin/defaults -currentHost write com.apple.screensaver 'ShowClock' -bool "false"
/usr/bin/defaults -currentHost write com.apple.screensaver 'tokenRemovalAction' -int "0"

## Set Type of Slideshow to "Flipup" (Results inconsistent)
/usr/bin/defaults -currentHost write com.apple.ScreenSaver.iLifeSlideshows 'styleKey' -string "Flipup" 

## Set location of photos to Fan Art 
/usr/bin/defaults -currentHost write com.apple.ScreenSaverPhotoChooser 'SelectedSource' -int "4"
/usr/bin/defaults -currentHost write com.apple.ScreenSaverPhotoChooser 'SelectedFolderPath' "/Manehattan Files/Manehattan Backgrounds/Fan Art"
/usr/bin/defaults -currentHost write com.apple.ScreenSaverPhotoChooser 'ShufflesPhotos' -bool "true"

## Removes the .plist LaunchAgent from inside the User Launch Agent Folder. 
rm -f ~/Library/LaunchAgents/set-screensaver.plist

exit

```

1

So through JAMF, a very wise man showed me a very simple thing I needed to add to the end of my script:

killall cfprefsd

Solved the problem entirely. While if you go into System Preferences, it still shows the old screensaver being selected, it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .