Supported Devices
Any Mac that is running 10.15 or later and enrolled Jamf Pro
Jamf Pro Account
Jamf Pro Setup Instructions
Setup Script
To get started you will need to click on the GEAR in the upper right corner to go to your settings. Then click on Computer Management which will give the option to select Scripts in the above screenshot.
When you create your new Script you will be required to create a Display Name and then you will click on the Script tab and paste the script below.
#!/bin/sh SERVER=##server##.carouselsignage.net PLAYERID=##playerid## # adapted from https://www.jamf.com/jamf-nation/discussions/34706/a-guide-for-custom-screen-savers user=$(last | grep "logged in" | grep "console" | awk '{print $1}'); huuid=$(system_profiler SPHardwareDataType | awk '/Hardware UUID/ {print $3}') ssPlist="/Users/$user/Library/Preferences/ByHost/com.apple.screensaver.$huuid.plist" configPlist="/Users/$user/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Preferences/ByHost/com.trms.Carousel-Cloud-Screensaver.$huuid.plist" screenSaverModuleName="Carousel_Cloud" screenSaverFileName="Carousel Cloud.saver" screenSaverPath="/Library/Screen Savers" mkdir -p "/Users/$user/Library/Preferences/ByHost" mkdir -p "/Users/$user/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Preferences/ByHost" mkdir -p "$screenSaverPath" # Download the current version of the screen saver curl -s -o "/tmp/screenSaverFileName" https://carousel-public-files.s3.amazonaws.com/Carousel.Cloud.Screen.Saver.dmg MNT=$(hdiutil attach "/tmp/screenSaverFileName" | egrep '^/dev/disk[0-9]*s[0-9]*' | tr '\t' ' ' | tr -s ' ') DISKPATH=$(echo $MNT | awk '{print $1}') MOUNTPATH=$(echo $MNT | cut -d' ' -f3-) # check if we need to update the screen saver by comparing it to the version we downloaded if [ -d "$screenSaverPath/$screenSaverFileName" ]; then MAJOR=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$screenSaverPath/$screenSaverFileName/Contents/Info.plist") MINOR=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$screenSaverPath/$screenSaverFileName/Contents/Info.plist") NEWMAJOR=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$MOUNTPATH/$screenSaverFileName/Contents/Info.plist") NEWMINOR=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$MOUNTPATH/$screenSaverFileName/Contents/Info.plist") if [ "$MAJOR.$MINOR" != "$NEWMAJOR.$NEWMINOR" ]; then ditto "$MOUNTPATH/$screenSaverFileName" "$screenSaverPath/$screenSaverFileName" fi else # or if the screen saver isn't installed, install it ditto "$MOUNTPATH/$screenSaverFileName" "$screenSaverPath/$screenSaverFileName" fi # clean up the downloaded image hdiutil detach $DISKPATH rm -f "/tmp/screenSaverFileName" # set the screen saver for the current user to the one we installed echo "Setting screen saver for $user..." /usr/libexec/PlistBuddy -c "Print moduleDict" $ssPlist if [ $? -eq 1 ]; then /usr/libexec/PlistBuddy -c "Add :moduleDict dict" $ssPlist fi /usr/libexec/PlistBuddy -c "Print moduleDict:moduleName" $ssPlist if [ $? -eq 1 ]; then /usr/libexec/PlistBuddy -c "Add :moduleDict:moduleName string Carousel_Cloud" $ssPlist else /usr/libexec/PlistBuddy -c "Set :moduleDict:moduleName Carousel_Cloud" $ssPlist fi /usr/libexec/PlistBuddy -c "Print moduleDict:path" $ssPlist if [ $? -eq 1 ]; then /usr/libexec/PlistBuddy -c "Add :moduleDict:path string /Library/Screen Savers/Carousel Cloud.saver" $ssPlist else /usr/libexec/PlistBuddy -c "Set :moduleDict:path /Library/Screen Savers/Carousel Cloud.saver" $ssPlist fi chown $user "$ssPlist" # also configure the screen saver to show the server's content if [ -f "$configPlist" ]; then /usr/libexec/PlistBuddy -c "Set :siteName $SERVER" "$configPlist" /usr/libexec/PlistBuddy -c "Set :playerID $PLAYERID" "$configPlist" else /usr/libexec/PlistBuddy -c "Add :siteName string $SERVER" "$configPlist" /usr/libexec/PlistBuddy -c "Add :playerID string $PLAYERID" "$configPlist" plutil -convert binary1 "$configPlist" fi killall cfprefsd
Setup Policy
The last thing you will need to set up is the Policy. You will need to go back to Computers on the top left and select Policies. When you are setting up your Policy, you will need to select a name and a Trigger that meets your organization’s needs and you will need to select the Script that we previously added. We recommend using the Startup or Login trigger because the script will download the latest version of the Screen Saver and check if it needs to be updated. Lastly, you will need to configure your Policy according to your organization's best practices.