Screensaver settings spontaneously revert

Solution 1:

(Answering my own question)

This problem never went away for me, but I do have a workaround. I found the preferences that kept changing were in com.apple.ScreenSaverPhotoChooser. I set everything the way I wanted it in System Preferences, then read all the values from that preference file with

defaults -currentHost read com.apple.ScreenSaverPhotoChooser

I then copied all those values into a script that would write them back to the same preference file whenever it spontaneously changed its values.

#!/bin/bash
defaults -currentHost write com.apple.ScreenSaverPhotoChooser CustomFolderDict -dict identifier \"/Users/me/Pictures/MyFolder\" name MyFolder
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath \"/Users/me/Pictures/MyFolder\"
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedSource -int 4
defaults -currentHost write com.apple.ScreenSaverPhotoChooser ShufflesPhotos -bool true

(I may be able to combine all those lines into one line; I am not sure about that and haven't tried it.)

I saved the script as ~/bin/screen-saver-prefs and made it executable. Whenever I happen to notice that my screen saver is not doing what I want, I just open up a terminal and run screen-saver-prefs at the prompt. ~/bin is on my PATH, so I don't need to reference the directory. If you don't want to do that, just use the full path to the script to run it.

It's not the most elegant or efficient solution, but it works.

Solution 2:

Is your machine a member of an Active Directory domain with a group policy set to have the screensaver work in a certain way?

Where I work they have policies for such things, as well as proxy settings that break Yosemite. It may be (if you are similarly tied to Active Directory) that you could have something similar going on.

Solution 3:

I upgraded to 10.10.2 and I thought the problem had been fixed but it hasn't. This is what I have found out which sheds some light but I don't know how to fix it.

In the ~/Library/Preferences/ByHost Folder there is the screen saver files. The one in question I see is this one:

com.apple.ScreenSaverPhotoChooser.3894DB94-8127-583F-A292-E5634E257DF3.plist

After setting my screensaver information properly. the XML file contains this: <plist version="1.0"> <dict> <key>LastViewedPhotoPath</key> <string></string> <key>SelectedMediaGroup</key> <string>2CE52ED9-1E40-4569-816A-1B5A446FC00F</string> <key>SelectedSource</key> <integer>1</integer> <key>ShufflesPhotos</key> <true/> </dict> </plist>

After the screensaver is run, it looks like this:

<plist version="1.0"> <dict> <key>LastViewedPhotoPath</key> <string>/path/to/last/image/(my proper image that it was viewing)</string> <key>SelectedSource</key> <integer>1</integer> <key>ShufflesPhotos</key> <true/> </dict> </plist>

After running it again, it turned to this. <plist version="1.0"> <dict> <key>LastViewedPhotoPath</key> <string>/Library/Screen Savers/Default Collections/1-National Geographic/NatGeo03.jpg</string> <key>SelectedFolderPath</key> <string>/Library/Screen Savers/Default Collections/1-National Geographic</string> <key>SelectedSource</key> <integer>3</integer> <key>ShufflesPhotos</key> <true/> </dict> </plist>

Unfortunately, even if I copy the original plist back into the folder, the settings don't revert. But Obviously, I'm seeing the "SelectedMediaGroup" is missing after the screensaver runs once. and then it doesn't know what to do so it reverts to National Geographic as the default.