custom ScreenSaver issue

akurpios-euvic
New Contributor II

Hello,

First of all my setup:
Jamf Pro cloud 10.37.2

MacOS Monterey 12.3.1 on i9 2019 MBP

I received from the Marketing team a screensaver. I need to deploy this .saver to macOS devices. So:
1. I'm deploying it as DMG to ~/Library/Screen Savers/MovieSaver.saver - which is working great. I have no issues with setting it manually.

2. I'm trying to enforce macOS to use this screen saver with idle 300s. Which I cannot do via:
A) pre-configured Configuration profile

akurpioseuvic_0-1649770696971.png

B) manual Configuration profile

 

<?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>idleTime</key>
	<integer>10</integer>
	<key>moduleDict</key>
	<dict>
		<key>moduleName</key>
		<string>MovieSaver</string>
		<key>path</key>
		<string>~/Library/Screen Savers/MovieSaver.saver</string>
		<key>type</key>
		<integer>0</integer>
	</dict>
</dict>

 

 C) Bash script in very various configuration

 

user=$(`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`)
huuid=$(system_profiler SPHardwareDataType | awk '/Hardware UUID/ {print $3}')
screenSaverModuleName="MovieSaver"
screenSaverFileName="MovieSaver.saver"
screenSaverPath="/Users/shared"
defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName $screenSaverModuleName path $screenSaverPath/$screenSaverFileName/ type 0
killall cfprefsd

 

As you can see I've tried to deploy and enforce that from /Users/Shared, and from /Library instead of ~/ Library

nothing worked... :(

What I'm doing wrong?
The closest solution was the mobileconfig, but it won't choose the screensaver, only set the idle.

Thanks in advance

Alex

P.S. I'm fighting with it since 16 man-hour

Best Regards
Inż. Aleksander Kurpios
Administrator Systemu / System Administrator
5 REPLIES 5

pete_c
Contributor III

I just went through something similar.  See thread here. 

Hello,
Thank you for your reply. So, using this, but allowing to activate the screensaver for the 1st time - not checking after script deploy should works? I'll test it in a momoment.

 

#!/bin/bash

# https://community.jamf.com/t5/jamf-pro/custom-screensaver-script-is-not-working-on-big-sur/m-p/263046/highlight/true#M242126

## get current user

user=$( scutil <<< "show State:/Users/ConsoleUser" | awk -F': ' '/[[:space:]]+Name[[:space:]]:/ { if ( $2 != "loginwindow" ) { print $2 }}' )

## get macOS version(s)

osMajor=$(/usr/bin/sw_vers -productVersion | /usr/bin/awk -F"." '{print $2}')
osMinor=$(/usr/bin/sw_vers -productVersion | /usr/bin/awk -F"." '{print $3}')

## set key items for screensaver

/usr/bin/sudo -u "$user" /usr/bin/defaults -currentHost write com.apple.screensaver CleanExit -string "YES"
/usr/bin/sudo -u "$user" /usr/bin/defaults -currentHost write com.apple.screensaver PrefsVersion -int 100
/usr/bin/sudo -u "$user" /usr/bin/defaults -currentHost write com.apple.screensaver showClock -string "NO"
/usr/bin/sudo -u "$user" /usr/bin/defaults -currentHost write com.apple.screensaver idleTime -int 300

## configure screensaver framework based on macOS version

if [[ $osMajor -eq 14 ]] && [[ $osMinor -ge 2 ]]; then
    /usr/bin/sudo -u "$user" /usr/bin/defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName -string "MovieSaver" path -string "/Users/$user/Library/Screen Savers/MovieSaver.saver" type -int 0
  else
    /usr/bin/sudo -u "$user" /usr/bin/defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName -string "MovieSaver" path -string "/Users/$user/Library/Screen Savers/MovieSaver.saver" type -int 0
fi

## additional configuration settings for screensaver framework

/usr/bin/sudo -u "$user" /usr/bin/defaults -currentHost write com.apple.screensaver tokenRemovalAction -int 0

/usr/bin/sudo /usr/bin/killall -hup cfprefsd

exit 0

 

 
 

 

 

Best Regards
Inż. Aleksander Kurpios
Administrator Systemu / System Administrator

@pete_c, still not working... :(

Best Regards
Inż. Aleksander Kurpios
Administrator Systemu / System Administrator

dmccluskey
Contributor II

its not you its jamf

they are missing 

<key>loginWindowModulePath</key>

<string>/System/Library/Screen Savers/Drift.saver</string> <key>moduleName</key> <string>Drift</string>

 

from the screensaver profile.

I opened it ticket with them in nov-2021

they still havent fixed it.

 

We have filed PI-010337 requesting to add the "modulename" Key to the Configuration Profile. Once PI-010337 is updated, an email will be sent to notify you of the update.

So I'll try with

 

 

<?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>idleTime</key>
	<integer>10</integer>
	<key>moduleDict</key>
	<dict>
		<key>moduleName</key>
		<string>MovieSaver</string>
		<key>path</key>
		<string>~/Library/Screen Savers/MovieSaver.saver</string>
		<key>loginWindowModulePath</key>
                <string>~/Library/Screen Savers/MovieSaver.saver</string>
                <key>type</key>
		<integer>0</integer>
	</dict>
</dict>

 

 

Update:
@dmccluskeyalso not working :(
Best Regards
Inż. Aleksander Kurpios
Administrator Systemu / System Administrator