How to turn off screen saver for remote desktop sessions in macOS Catalina?
Purchased an M1 Mac Mini. Running it headless. In the OS for my user, I have the screen saver set to "never." However, when I connect via remote desktop, the screen saver comes on after some period of time.
Where is the plist or setting to completely disable the screen saver for remote desktop sessions?
I think I found the solution. I noticed an energy saver plist with a UID appended to it.
/Library/Preferences/com.apple.PowerManagement.{UID}.plist
In addition to the default
/Library/Preferences/com.apple.PowerManagement.plist
Reading the default plist with my correct system settings gave me
{
"AC Power" = {
"Automatic Restart On Power Loss" = 1;
DarkWakeBackgroundTasks = 1;
"Disk Sleep Timer" = 10;
"Display Sleep Timer" = 0;
"System Sleep Timer" = 0;
"Wake On LAN" = 1;
};
SystemPowerSettings = {
"Update DarkWakeBG Setting" = 1;
};
}
Reading the plist with the UID gave me
{
"AC Power" = {
PrioritizeNetworkReachabilityOverSleep = 0;
"Sleep On Power Button" = 1;
"Standby Enabled" = 0;
TCPKeepAlivePref = 1;
TTYSPreventSleep = 1;
};
}
So I added the "System Sleep Timer" = 0 and "Display Sleep Timer" 0
by the following linesp.
sudo defaults write /Library/Preferences/com.apple.PowerManagement.{UID}.plist "AC Power" -dict-add "System Sleep Timer" 0
sudo defaults write /Library/Preferences/com.apple.PowerManagement.{UID}.plist "AC Power" -dict-add "Display Sleep Timer" 0