How to change the the screensaver using terminal (without using Preference Panel)

screensaver

I would like to change the screensaver "Flurry" by the Ken Burns without using the Preference panel, directly using terminal or command.

Best Answer

  1. Quit System Preferences.

  2. Locate the relevant plist in terminal by

    ls ~/Library/Preferences/ByHost/com.apple.screensaver.*.plist
    

    You should see something like

    /Users/<username>/Library/Preferences/ByHost/com.apple.screensaver.0B39A0DE-D1EE-59FF-85C0-6EA16FCB015B.plist
    

    Note that hyphen-delimited alphanumeric string. It might be host dependent, judging from that ByHost directory name. (Or maybe it's not. At the moment I have only one Mac at my disposal so I can't tell.)

  3. In terminal, run the following commands (with the hyphen-delimited alphanumeric string replaced by what you found in the last step):

    defaults write ~/Library/Preferences/ByHost/com.apple.screensaver.0B39A0DE-D1EE-59FF-85C0-6EA16FCB015B.plist moduleDict -dict moduleName iLifeSlideshows path /System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver type 0
    defaults read ~/Library/Preferences/ByHost/com.apple.screensaver.0B39A0DE-D1EE-59FF-85C0-6EA16FCB015B.plist
    

That's it. There's one problem with this approach: it seems that multiple screensavers are registered with this iLifeSlideshows.saver (e.g. Classic), and I couldn't locate the plist controlling which one is shown. But according my testing, if you've chosen "Ken Burns" in System Preferences and later changed it to "Flurry", then when you run the above commands you will get "Ken Burns" back. Otherwise, no guarantee — for instance, you might get "Classic" if that's the last used one from iLifeSlideshows.saver.