TweetFollow Us on Twitter

MacEnterprise: Custom Slide Show Screen Savers

Volume Number: 26
Issue Number: 02
Column Tag: MacEnterprise

MacEnterprise: Custom Slide Show Screen Savers

Leveraging a new Snow Leopard feature for informational displays

By Greg Neagle, MacEnterprise.org

Introduction

In a previous MacEnterprise column, we looked at a new Snow Leopard feature: a screen saver now runs over the LoginWindow when the Mac has been idle for a while. We looked at using MCX and defaults to control which screen saver runs at the LoginWindow, and how long the computer must be idle before it runs. We also discussed why some organizations might want to control the screensaver at the LoginWindow. In instructional labs, students gravitate towards machines that look "alive", and may assume a machine with a dark display is broken, even though it might just be asleep. Also, many organizations want to leave their machines on and awake when no one is logged in so that administrative tasks can be performed in the off-hours. So if you are going to leave these machines on, and their displays active, you might want to have them perform a useful function while they are sitting at the LoginWindow. One possibility is to implement a screen saver that displays news updates or important announcements for your organization, or even something as simple as lab hours and policies.

Making a Slide Show

If you open the Desktop & Screen Saver preference pane in System Preferences, you've probably noticed the option to choose a folder of pictures to use as a screen saver. You may be thinking that all you need to do to create a custom informational display is to install a folder of pictures to be the slides for your informational display then use MCX or defaults to manage com.apple.screensaver preferences to show the pictures in that folder. But there are some problems with this approach:

1. Even after adding the preferences manifests from /System/Library/CoreServices/ManagedClient.app, Workgroup Manager has no options for managing the folder of pictures to use as the screen saver.

2. When using "slide show" screen savers, the default behavior of panning and zooming may not be the best way to present informational slides.

3. The default time each slide is shown (which appears to be ten seconds) might be too short to read the information on each slide; you may want the slides to switch more slowly. There doesn't appear to be any option for controlling the time each slide is displayed.

The first two issues might be solvable by managing additional preferences. For example: it might be possible to get the desired result by managing preferences in com.apple.screensaver.slideshow, and adding additional items to manage in com.apple.screensaver. But in Snow Leopard, the defaults entries for slide show screensavers are more complicated than they were in prior OS releases. I, for one, have not been able to set up a slide show screensaver that shows a custom folder of pictures over the LoginWindow using only MCX management or its equivalent defaults entries in /Library/Preferences.

SlideSavers

As it turns out, there is a fairly straightforward solution to all of these issues. Again, when you've used the Desktop & Screen Saver preference pane in System Preferences, you may have noticed the built-in slide show screensavers—the ones with names like Abstract, Beach, Cosmos, and so on. A visit to /System/Library/Screen Savers shows us that these are another type of bundle. In the Screen Savers folder, the Abstract screen saver is actually called Abstract.slideSaver. If you control-click on Abstract.slideSaver and choose Show Package Contents to open the bundle contents, you'll see the contents are quite simple: a few plist files and a Resources directory containing the pictures to display and some language-localized strings, as shown in Figure 1.


Figure 1 - Abstract.slideSaver contents

So if a slideSaver is a just a folder of pictures with some metadata around it, this suggests it should be very simple to create our own custom slideSaver. And it is.

Start by copying the Abstract slideSaver to /Library/Screen Savers/:

> cd /System/Library/Screen\ Savers/
> cp -R Abstract.slideSaver /Library/Screen\ Savers/

Then rename it:

> cd /Library/Screen\ Savers/
> mv Abstract.slideSaver MyCustom.slideSaver

Now we need to edit some of the metadata. Start with /Library/ScreenSavers/MyCustom.slideSaver/Contents/Info.plist, which initially will look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>CFBundleDevelopmentRegion</key>
   <string>English</string>
   <key>CFBundleGetInfoString</key>
   <string>Abstract screen saver module</string>
   <key>CFBundleIdentifier</key>
   <string>com.apple.screensaver.Abstract</string>
   <key>CFBundleInfoDictionaryVersion</key>
   <string>6.0</string>
   <key>CFBundleName</key>
   <string>Abstract</string>
   <key>CFBundlePackageType</key>
   <string>BNDL</string>
   <key>CFBundleShortVersionString</key>
   <string>1.3</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>CFBundleVersion</key>
   <string>1.3</string>
</dict>
</plist>

Edit the values of CFBundleGetInfoString, CFBundleIdentifier, and CFBundleName to reflect the name of your custom slideSaver. When you are finished, it should look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>CFBundleDevelopmentRegion</key>
   <string>English</string>
   <key>CFBundleGetInfoString</key>
   <string>Custom saver module</string>
   <key>CFBundleIdentifier</key>
   <string>com.mactech.screensaver.MyCustom</string>
   <key>CFBundleInfoDictionaryVersion</key>
   <string>6.0</string>
   <key>CFBundleName</key>
   <string>MyCustom</string>
   <key>CFBundlePackageType</key>
   <string>BNDL</string>
   <key>CFBundleShortVersionString</key>
   <string>1.3</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>CFBundleVersion</key>
   <string>1.3</string>
</dict>
</plist>

Next, edit the localized language strings. On my computer, I have only an English.plist folder inside Contents/Resources. You may have additional languages. For the English language strings, edit English.lproj/InfoPlist.strings, found in /Library/ScreenSavers/MyCustom.slideSaver/

Contents/Resources/. Initially, it will look like this:

"CFBundleName" = "Abstract";

Change the name to match your custom slideSaver's name and save it:

"CFBundleName" = "MyCustom";

Before we go any further, we should test our changes. Open System Preferences, choose the Desktop & Screen Saver preference pane, and you should see MyCustom (or whatever you've named it) in the list of available screen savers. If you select it, you'll see a screen saver identical to the Abstract screen saver - because we haven't yet changed the pictures included in the slideSaver.

The next part is the fun part: replace all the pictures in /Library/ScreenSavers/MyCustom.slideSaver/Contents/Resources/ with your own! For informational signage, one convenient way to generate content for the slideSaver is to use Keynote (or even PowerPoint). Make your slides (and leave off any animation or transitions), then export them as pictures - one picture per slide. If you keep the original Keynote or PowerPoint document, you can revise it in the future, and then re-export the slides as needed.

When creating the content, make sure you consider the aspect ratio of the displays you will be using it on. If you design widescreen content on your laptop, but deploy the custom screensaver on a lab full of desktop machines with 4:3 screens, you may find important content cut off on the sides. Conversely, if you design the content on a 4:3 screen and it gets displayed on a screen with a wide aspect ratio, it may have ugly black bars on the sides or, if the slides are zoomed to fill the display, content is cut off the top and bottom. One approach to deal with these issues is to create the content with a widescreen slide aspect ratio, but keep the important content within the 4:3 center area. This way, the slides display correctly on widescreen displays, and when the sides are cropped on standard aspect ratio displays, nothing important is lost. Experiment and see what works best for you.

In Figure 2, I've created a short slide show in Keynote, and exported it as slides. I then copied those into the Resources folder inside the slideSaver.


Figure 2 - our custom slideSaver with custom slides

Configuring the SlideSaver

If you now test your custom slideSaver, you'll see your slides, but unless you've set different options, the default behavior of panning and zooming may not be the best way to display your slides. Showing the slides in random order may also be not what is wanted. In the Screen Saver preference pane, you can click the Options... button and adjust the behavior to your liking.

But that now presents another problem - since you want something other than the default preferences, you now have to manage an additional set of preferences, since the preferences for slideSavers are not stored in com.apple.screensaver; instead they are stored in com.apple.screensaver.<slide_saver_name>. For our example custom slideSaver, they'd be stored in com.apple.screensaver.MyCustom:

> defaults -currentHost read com.apple.screensaver.MyCustom
{
    Center = 1;
    Crop = 0;
    Crossfade = 0;
    DisplayType = Slides;
    Random = 0;
    Zoom = 1;
}

So we could create our custom slideSaver, deliver it to our all our machines, and then use MCX or defaults to manage com.apple.screensaver to set the LoginWindow screensaver to our custom slideSaver. We could also use MCX or defaults to manage the com.apple.screensaver.customslidesavername preferences to get the desired display behavior. But as you may have guessed, there is an easier way. It turns out that you can include your desired preferences inside the slideSaver bundle.

To specify the "default" defaults for the slideSaver, you need to create a .Settings.plist file in the Contents/Resources directory of the slideSaver:

>cat MyCustom.slideSaver/Contents/Resources/.Settings.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>Center</key>
   <true/>
   <key>Crop</key>
   <false/>
   <key>Crossfade</key>
   <false/>
   <key>DisplayType</key>
   <string>Slides</string>
   <key>Random</key>
   <false/>
   <key>Zoom</key>
   <true/>
</dict>
</plist>

The settings above correspond to the options in Figure 3. Adjust the values to match your preferred options.


Figure 3 - slideSaver options

We have one more problem to solve. The default ten-second time for each slide might be too short for your content - what if you want fifteen or twenty seconds per slide? The GUI options as seen in Figure 3 have no way to specify the slide duration.

Hidden Preference Hunting

It's not uncommon for OS X applications to have hidden preferences - that is, preferences that are not exposed via the GUI. A common way to hunt for hidden preferences is to use strings. This is a UNIX command-line utility that prints all the strings in a binary file, typically an executable. Since OS X defaults are stored in plist files with strings for keys, this is an effective way to find defaults keys that aren't exposed in the GUI.

The slideSaver bundles have no executable code - they are just data for the Pictures Folder.saver, located at /System/Library/Frameworks/ScreenSaver.framework/Resources/Pictures Folder.saver. The Pictures Folder.saver is itself a bundle, with the executable located at Contents/MacOS/Pictures Folder. This is the executable we must run the strings utility against:

> cd /System/Library/Frameworks/ScreenSaver.framework
> cd Resources
> cd Pictures\ Folder.saver/Contents/MacOS
> strings Pictures\ Folder
Thumbs
failed to open directory %s
can't get fsRef for path %s
can't read path %s
can't resolve alias %s
...

On Mac OS X 10.6.2, strings prints 1819 lines of strings from the Pictures Folder executable. That's a lot to look through. But we're looking for something to do with the number of seconds each slide displays, so we can use grep to narrow down the results:

> strings Pictures\ Folder | grep -i seconds
_delaySeconds
setupTransition:delaySeconds:
MosaicTransitionSeconds
MosaicTransitionDelaySeconds
MosaicZoomSeconds
_zoomSeconds
_transitionSeconds
_pauseSeconds

Some of those look promising, but most don't really follow the naming convention for defaults keys, which is "CamelCase", where all words are run together and capitalized, including the first word. The only ones that are in CamelCase are the "Mosaic" ones, and again, those don't seem right. So we try something else:

> strings Pictures\ Folder | grep -i delay
_delaySeconds
setupTransition:delaySeconds:
MosaicTransitionDelaySeconds
performSelector:withObject:afterDelay:
_delayStartTime

Those don't look any more promising. One more variation:

> strings Pictures\ Folder | grep -i time
setAnimationTimeInterval:
_startTime
{?="iterations"l"durations"[30d]"minFrameRate"d"lastPrintedAvg"d"lastDrawTime"@"NSDate"}
_rssStartTime
timeIntervalSinceNow
dateWithTimeIntervalSinceNow:
Times-Italic
dropTime
inertiaTime
_dropTime
_inertiaTime
timeRemainingInDrop
timeIntervalSinceDate:
_delayStartTime
setTimeStyle:
_updateTimer
_fadeTimer
_fadeStartTime
FadeTime
ZoomTime
zoomTime
fadeTime
_bgTimer
@"NSTimer"
_zoomTime
_fadeTime
[3{SlideShowTexGeometry="state"i"startTime"d"endTime"d"nowTime"d"startPt"
{?="x"f"y"f"z"f}"endPt"{?="x"f"y"f"z"f}"nowPt"{?="x"f"y"f"z"f}"imageRect"
{_NSRect="origin"{_NSPoint="x"f"y"f}"size"{_NSSize="width"f"height"f}}
"scaleFactor"f"forward"c"valid"c"path"@"NSString""imageIndex"i}]
_fgFrameRateTime
_bgFrameRateTime
NSTimer
gettimeofday returned -1: %s
dateWithCalendarFormat:timeZone:
timedOut
_startTimeoutTimer
scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:

Ugh. Thirty-five results, but two look promising:

FadeTime
ZoomTime

These are in CamelCase and seem to have something to do with slide timing. We can check the context like so:

> strings Pictures\ Folder | grep -10 ZoomTime

f24@0:4{_NSSize=ff}8{_NSSize=ff}16
scaledImageSizeForImageSize:tileSize:
{_NSSize=ff}24@0:4{_NSSize=ff}8{_NSSize=ff}16
drawAt3DPoint:scale:alpha:
v32@0:4{?=fff}8{_NSSize=ff}20f28
loadAllTiles2
loadAllTiles
loadNextTile
c36@0:4^v8{_NSSize=ff}12{_NSSize=ff}20I28I32
FadeTime
ZoomTime
Random
Crop
Crossfade
plist
.Settings
.Settings.plist
zoomTime
fadeTime
ZoomMode
NO_IMAGES_FULL

When you pass a number to grep, it prints that many lines of context before and after each match. In this case, we see some familiar defaults keys, namely Random, Crop, and Crossfade, so we can be more confident that FadeTime and ZoomTime might be hidden preference keys. You can now also guess how I discovered the .Settings.plist file.

Once you've found some possible undocumented defaults keys, all that is left is to try them out and see. After some experimentation, I determined that ZoomTime was the key I was looking for. To have the slides in your custom slideSaver display for twenty seconds each, your .Settings.plist might look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>ZoomTime</key>
   <integer>20</integer>
   <key>Center</key>
   <true/>
   <key>Crop</key>
   <false/>
   <key>Crossfade</key>
   <false/>
   <key>DisplayType</key>
   <string>Slides</string>
   <key>Random</key>
   <false/>
   <key>Zoom</key>
   <true/>
</dict>
</plist>

It also turns out that FadeTime controls how long the cross fade takes for each slide. For this custom slideSaver, we've turned off the cross fade, but if you wanted to control it, you could.

Implementation

Now we have a custom slideSaver with our informational slides. We've included a .Settings.plist file in its Resources directory so we can control the slideSaver options without having to manage yet another set of preferences. Now we're ready to implement it on our client machines.

If you read the earlier column where we looked at MCX management of the LoginWindow screensaver preferences, you may remember that we can get virtually the same control by installing a properly configured /Library/Preferences/

com.apple.screensaver.plist file. You can create this file using the defaults command. For example, the following commands would set the idle time to five minutes and set the screensaver to be run over the LoginWindow to our custom slideSaver (watch the line breaks, these are two commands, each all on a single line):

> defaults write /Library/Preferences/com.apple.screensaver 
      loginWindowIdleTime -int 300
> defaults write /Library/Preferences/com.apple.screensaver 
      loginWindowModulePath 
      "/Library/Screen Savers/MyCustom.slideSaver"

So you have a choice: manage the LoginWindow screensaver via MCX, or just install the preference file. Since you are going to have to deliver the files that make up the custom slideSaver to each machine, it might be convenient to just deliver the /Library/Preferences/com.apple.screen

saver.plist file at the same time. Of course, remember that an admin user could modify or remove the preference file once it has been installed. MCX management is a little more temper-proof. The choice is yours.

If you are using a software distribution mechanism that relies on Apple packages, now is the time to package up your custom slideSaver (and maybe the com.apple.screensaver.plist file.) Deliver the custom slideSaver to all your managed machines. Once it has been delivered to each machine, if you've opted to manage the LoginWindow screensaver via MCX, now you can use Workgroup Manager and MCX to manage the LoginWindow screen saver preferences as in Figure 4.


Figure 4 - Screen Saver Loginwindow preference management

Conclusion

That's it! We've created a custom slideSaver by copying and modifying an existing slideSaver. We've customized the slideSaver's options by including a .Settings.plist file for our custom settings. We've done some hunting for hidden preferences to further customize our slideSaver's behavior. Finally, we've used both MCX and defaults to set our custom slideSaver as the screensaver to be displayed over the LoginWindow.

If you manage a lab of Mac OS X machines, you can use the techniques we've explored in this column and the earlier MacEnterprise column to create an informational slideshow that runs over the LoginWindow, putting your machines to useful purpose even when they aren't been used. Outside of instructional labs, enterprise administrators could use these techniques as well, but might also use MCX to manage com.apple.screensaver.ByHost preferences to have the custom slideSaver run over an idle user session as well.


Greg Neagle is a member of the steering committee of the Mac OS X Enterprise Project (macenterprise.org) and is a senior systems engineer at a large animation studio. Greg has been working with the Mac since 1984, and with OS X since its release. He can be reached at gregneagle@mac.com.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Fresh From the Land Down Under – The Tou...
After a two week hiatus, we are back with another episode of The TouchArcade Show. Eli is fresh off his trip to Australia, which according to him is very similar to America but more upside down. Also kangaroos all over. Other topics this week... | Read more »
TouchArcade Game of the Week: ‘Dungeon T...
I’m a little conflicted on this week’s pick. Pretty much everyone knows the legend of Dungeon Raid, the match-3 RPG hybrid that took the world by storm way back in 2011. Everyone at the time was obsessed with it, but for whatever reason the... | Read more »
SwitchArcade Round-Up: Reviews Featuring...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for July 19th, 2024. In today’s article, we finish up the week with the unusual appearance of a review. I’ve spent my time with Hot Lap Racing, and I’m ready to give my verdict. After... | Read more »
Draknek Interview: Alan Hazelden on Thin...
Ever since I played my first release from Draknek & Friends years ago, I knew I wanted to sit down with Alan Hazelden and chat about the team, puzzle games, and much more. | Read more »
The Latest ‘Marvel Snap’ OTA Update Buff...
I don’t know about all of you, my fellow Marvel Snap (Free) players, but these days when I see a balance update I find myself clenching my… teeth and bracing for the impact to my decks. They’ve been pretty spicy of late, after all. How will the... | Read more »
‘Honkai Star Rail’ Version 2.4 “Finest D...
HoYoverse just announced the Honkai Star Rail (Free) version 2.4 “Finest Duel Under the Pristine Blue" update alongside a surprising collaboration. Honkai Star Rail 2.4 follows the 2.3 “Farewell, Penacony" update. Read about that here. | Read more »
‘Vampire Survivors+’ on Apple Arcade Wil...
Earlier this month, Apple revealed that poncle’s excellent Vampire Survivors+ () would be heading to Apple Arcade as a new App Store Great. I reached out to poncle to check in on the DLC for Vampire Survivors+ because only the first two DLCs were... | Read more »
Homerun Clash 2: Legends Derby opens for...
Since launching in 2018, Homerun Clash has performed admirably for HAEGIN, racking up 12 million players all eager to prove they could be the next baseball champions. Well, the title will soon be up for grabs again, as Homerun Clash 2: Legends... | Read more »
‘Neverness to Everness’ Is a Free To Pla...
Perfect World Games and Hotta Studio (Tower of Fantasy) announced a new free to play open world RPG in the form of Neverness to Everness a few days ago (via Gematsu). Neverness to Everness has an urban setting, and the two reveal trailers for it... | Read more »
Meditative Puzzler ‘Ouros’ Coming to iOS...
Ouros is a mediative puzzle game from developer Michael Kamm that launched on PC just a couple of months back, and today it has been revealed that the title is now heading to iOS and Android devices next month. Which is good news I say because this... | Read more »

Price Scanner via MacPrices.net

Amazon is still selling 16-inch MacBook Pros...
Prime Day in July is over, but Amazon is still selling 16-inch Apple MacBook Pros for $500-$600 off MSRP. Shipping is free. These are the lowest prices available this weekend for new 16″ Apple... Read more
Walmart continues to sell clearance 13-inch M...
Walmart continues to offer clearance, but new, Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBooks... Read more
Apple is offering steep discounts, up to $600...
Apple has standard-configuration 16″ M3 Max MacBook Pros available, Certified Refurbished, starting at $2969 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free,... Read more
Save up to $480 with these 14-inch M3 Pro/M3...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
Amazon has clearance 9th-generation WiFi iPad...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Apple is offering a $50 discount on 2nd-gener...
Apple has Certified Refurbished White and Midnight HomePods available for $249, Certified Refurbished. That’s $50 off MSRP and the lowest price currently available for a full-size Apple HomePod today... Read more
The latest MacBook Pro sale at Amazon: 16-inc...
Amazon is offering instant discounts on 16″ M3 Pro and 16″ M3 Max MacBook Pros ranging up to $400 off MSRP as part of their early July 4th sale. Shipping is free. These are the lowest prices... Read more
14-inch M3 Pro MacBook Pros with 36GB of RAM...
B&H Photo has 14″ M3 Pro MacBook Pros with 36GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 Pro MacBook Pro (... Read more
14-inch M3 MacBook Pros with 16GB of RAM on s...
B&H Photo has 14″ M3 MacBook Pros with 16GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $150-$200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 MacBook Pro (... Read more
Amazon is offering $170-$200 discounts on new...
Amazon is offering a $170-$200 discount on every configuration and color of Apple’s M3-powered 15″ MacBook Airs. Prices start at $1129 for models with 8GB of RAM and 256GB of storage: – 15″ M3... Read more

Jobs Board

*Apple* Systems Engineer - Chenega Corporati...
…LLC,** a **Chenega Professional Services** ' company, is looking for a ** Apple Systems Engineer** to support the Information Technology Operations and Maintenance Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
*Apple* / Mac Administrator - JAMF Pro - Ame...
Amentum is seeking an ** Apple / Mac Administrator - JAMF Pro** to provide support with the Apple Ecosystem to include hardware and software to join our team and Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.