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

Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »

Price Scanner via MacPrices.net

New today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more
The latest Apple iPhone deals from wireless c...
We’ve updated our iPhone Price Tracker with the latest carrier deals on Apple’s iPhone 15 family of smartphones as well as previous models including the iPhone 14, 13, 12, 11, and SE. Use our price... Read more
Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more
Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more

Jobs Board

DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple 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
IT Systems Engineer ( *Apple* Platforms) - S...
IT Systems Engineer ( Apple Platforms) at SpaceX Hawthorne, CA SpaceX was founded under the belief that a future where humanity is out exploring the stars is Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.