Mac: Setting Screen Saver from the CLI

Earlier today I posted on how to activate the screen saver from the command line.  But I hadn’t yet mentioned how to set it up.  Before I do, let’s look at the /System/Library/Screen Savers directory.  Here you should see a number of bundles, such as RSS Visualizer.qtz, Paper Shadow.slideSaver, Flurry.saver, Arabesque.qtz and any third party screen savers you may have installed.  These are the paths to your screen savers. In order to set which screen saver you would like to use from the command line, you’re going to use the defaults command along with the domain.  First let’s read the settings there:
defaults -currentHost read
Which will provide the results:
{askForPassword = 1; moduleName = FDEScreenSaver; modulePath = “/usr/local/ppc-3.0.1-142/share/FDEScreenSaver.slideSaver”;}
When you feed information back in, to choose a new screen saver, the moduleName and modulePath (remember those paths in the first paragraph) will be used to specify a new screen saver.  Now I’m going to change my screen saver to use the iTunes Album artwork:
defaults -currentHost write modulePath -string “/System/Library/Screen Savers/iTunes Artwork.saver”
If you test it, it now works.  For good measure, I’m gonna’ change the moduleName as well, although in my experience I don’t really have to…
defaults -currentHost write moduleName -string “iTunes Artwork”
That askforPassword variable could also be changed.  If it is 0 on your machine then your screen saver doesn’t require a password in order to allow you back into your computer.  If it is a 1 then it does.
And remember you can use that earlier article from today to test them as you’re going (or use a hot corner, which is what I usually do).