Skip to main content

Hi,
I am required to force all users screen saver to display a collection of images as supplied by our IT Security department, and I'm trying to work out the best way to achieve this.
I have a a policy that successfully copies the screen savers to the Macs ok.
And I have a script stolen from another discussion that works, see below. But only if I manually trigger it via Casper remote. I have a policy that should trigger this at login/ ongoing and it reports that it runs successfully but it doesn't. Not sure if this is most efficient way of doing this as it runs every time any user logs in, repeatedly.
I was hoping there was a way via as configuration profile of adding the script but cant see a way to do this.



Anybody done this successfully please?
script...



!/bin/sh



Get user logged into console and put into variable "user"



user=ls -l /dev/console | cut -d " " -f 4



sudo -u $user defaults -currentHost write com.apple.screensaver CleanExit -string "YES"
sudo -u $user defaults -currentHost write com.apple.screensaver PrefsVersion -int 100
sudo -u $user defaults -currentHost write com.apple.screensaver showClock -string "YES"
sudo -u $user defaults -currentHost write com.apple.screensaver idleTime -int 120
sudo -u $user defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName -string "iLifeSlideshows" path -string "/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver" type -int 0
sudo -u $user defaults -currentHost write com.apple.screensaver tokenRemovalAction -int 0



sudo -u $user defaults -currentHost write com.apple.ScreenSaverPhotoChooser LastViewedPhotoPath -string ""
sudo -u $user defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath -string "/Users/Shared/Screensaver.secure"
sudo -u $user defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedSource -int 3



sudo -u $user defaults -currentHost write com.apple.ScreenSaver.iLifeSlideShows styleKey -string "Classic"



sudo killall -hup cfprefsd

@jlang_remedy It seems after the 10.14.3 supplemental update (18D109) it no longer works again. Anyone know if these locations changed again?



/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver
/System/Library/Frameworks/ScreenSaver.framework/PlugIns/iLifeSlideshows.appex


@DakotaS96 The iLifeSlideshows.saver appears to be gone after 10.14.3. the .appex file remains in the same location though.


Yup. The screensaver doesn't work for me as well. I was using @jlang_remedy 's script. It's not working any more. Let me know if you guys find anything. We're testing Mojave atm. and I want it to be the latest for now whatever for our work. So, that when we deploy in future, people don't come ask for updating it.



Thanks!


Those of you who have used Mojave and the script. Is it correct you then have disabled SIP to get this working ? (I know the script work now on latest mojave release)


@jlang_remedy did you manage to resolve this on 10.14.3?



Seems like "Classic" isn't selected for us when we run the script.



Thank You!


this is what we use now. Works on all version of macOS.



#!/bin/bash
# grab the system's uuid

if [[ `ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c27-50` != "00000000-0000-1000-8000-" ]]; then
macUUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c27-62`
fi

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

if [[ $osMajor -eq 14 ]] && [[ $osMinor -ge 2 ]]; then
defaults -currentHost write com.apple.screensaver CleanExit -string "YES"
defaults -currentHost write com.apple.screensaver PrefsVersion -int 100
defaults -currentHost write com.apple.screensaver idleTime -int 600
defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName -string "iLifeSlideshows" path -string "/System/Library/Frameworks/ScreenSaver.framework/PlugIns/iLifeSlideshows.appex" type -int 0
defaults -currentHost write com.apple.ScreenSaverPhotoChooser identifier -string "/System/Library/Images"
defaults -currentHost write com.apple.ScreenSaverPhotoChooser LastViewedPhotoPath -string "/System/Library/Images"
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath -string "/System/Library/Images"
defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedSource -int 4
defaults -currentHost write com.apple.ScreenSaverPhotoChooser ShufflesPhotos -int 1
defaults -currentHost write com.apple.ScreenSaver.iLifeSlideShows styleKey -string "ShiftingTiles"
else
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.screensaver.$macUUID.plist CleanExit "YES"
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.screensaver.$macUUID.plist PrefsVersion -int 100
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.screensaver.$macUUID.plist idleTime -int 600
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.screensaver.$macUUID.plist moduleDict -dict moduleName "iLifeSlideshows" path "/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver" type -int 0
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.ScreenSaverPhotoChooser.$macUUID.plist identifier "/System/Library/Images"
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.ScreenSaverPhotoChooser.$macUUID.plist LastViewedPhotoPath "/System/Library/Images"
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.ScreenSaverPhotoChooser.$macUUID.plist SelectedFolderPath "/System/Library/Images"
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.ScreenSaverPhotoChooser.$macUUID.plist SelectedSource -int 4
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.ScreenSaverPhotoChooser.$macUUID.plist ShufflesPhotos -int 1
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.ScreenSaver.iLifeSlideShows.$macUUID styleKey "ShiftingTiles"
defaults write /Users/$USER/Library/Preferences/ByHost/com.apple.ScreenSaver.iLifeSlideShows styleKey "ShiftingTiles"
fi

defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 0

Hi,
Great info here, but has anyone had to work with SaveHollywood utilizing a mp4 file? I am having 0 luck getting to work.


@sskamesh For the top part of the script, relating to Mojave and above, do you run this once per Mac and it applies to all current and future users of the Mac, or do you have to run it once per user?


Reply