bacongravy / macinbox

Puts macOS in a Vagrant box
Other
662 stars 45 forks source link

How to disable the screensaver? #39

Open egandro opened 5 years ago

egandro commented 5 years ago

Any (working) solution on how to disable the screensaver?

I only have a (very very) crude hack by a userscript.sh:

# echo "Disable screensaver"

# mv "${CHROOT}/Library/Screen Savers" "${CHROOT}/Library/Screen Savers.disabled"
# mv "${CHROOT}/System/Library/Screen Savers" "${CHROOT}/System/Library/Screen Savers.disabled"
egandro commented 5 years ago

Ok I have a solution. We should consider adding this to macinbox (by running it in a chroot envirorment).

OSX has profiles support - so it allows us to tweak system settings.

For the screensaver i found out so far:

1) Download this file: https://github.com/rodchristiansen/Profiles/blob/master/Kiosk/DisableScreenSaver.mobileconfig

2) Download this file: https://github.com/vmiller/profiles/blob/master/DisableScreenSaverPassword.mobileconfig

Run: sudo /usr/bin/profiles -I -F ./DisableScreenSaver.mobileconfig

Run: sudo /usr/bin/profiles -I -F ./DisableScreenSaverPassword.mobileconfig

It might be a very cool Idea to have a bunch of this Profiles in macinbox.

For example there are also solutions to whitelist Kexts without the db hack we currently use:

https://github.com/opragel/profiles/blob/master/macOS%20UAMDM%20-%20Kext%20Policy%20Example%20(Santa).mobileconfig

You can find a lot of profiles here:

https://github.com/clburlison/profiles