Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

azrael2001ca

macrumors newbie
Original poster
Oct 27, 2019
13
1
Hi All.

A question that hopefully someone can help me with. It will sound strange, but it is part of something bigger I am doing, so be forgiving. 🙃

I want to change the time when a screensaver starts with terminal.

IF I go “defaults -currenHost write com.apple.screensaver idleTime 0” (without the quotes) the time changes to NEVER
Screenshot 2024-12-05 at 11.22.25 AM.png


no problem.

Now when I go to reset the time to, for example 20 minutes, I use

“defaults -currentHost write com.apple.screensaver idleTime 1200” (without the quotes) it does not change back. It stays NEVER.

Any ideas as to why? And how to fix it?

Regards.
 
Perhaps the time should be in minutes, and 1200 minutes exceeds some limit. Note that for the 'pmset' command, most times are in minutes (e.g., 'sleep' for system sleep timer is in minutes).
 
Under an older macOS version, I checked what the units are by setting the time to 1 minute in the Preferences pane, then using 'defaults' to read the value. It says 60, so unless something was changed in the interim, I'd bet it's still in seconds. It's easy to test.
 
Did you quit Settings before setting idleTime to 1200? If not, then Settings won't re-read the stored value.
Hi. Thank you for the Response. I did not have System Settings open during the run. I opened terminal while running, and the pasted output shows the settings. The first part is when the program runs and sets the idleTime value to 0. The second after the program ends, where I reset the time.

defaults -currentHost read com.apple.screensaver
{
CleanExit = 1;
idleTime = 0;
idletime = 0;
lastDelayTime = 1200;
moduleDict = {
moduleName = iLifeSlideshows;
path = "/System/Library/ExtensionKit/Extensions/iLifeSlideshows.appex";
type = 0;
};
}

defaults -currentHost read com.apple.screensaver

{
CleanExit = 1;
idleTime = 3600;
idletime = 3600;
lastDelayTime = 1200;
moduleDict = {
moduleName = iLifeSlideshows;
path = "/System/Library/ExtensionKit/Extensions/iLifeSlideshows.appex";
type = 0;
};
}
 
Perhaps the time should be in minutes, and 1200 minutes exceeds some limit. Note that for the 'pmset' command, most times are in minutes (e.g., 'sleep' for system sleep timer is in minutes).

Thanks for the reply Brian.

The time is in seconds. I determined this by setting various options through the System Settings. As was said by someone in the thread, if you set it to 1 minute, it shows as 60 seconds in the defaults command.

The terminal response after setting the screensaver idle time to 1 minute

defaults -currentHost read com.apple.screensaver
{
CleanExit = 1;
idleTime = 60;
idletime = 3600;
lastDelayTime = 1200;
moduleDict = {
moduleName = iLifeSlideshows;
path = "/System/Library/ExtensionKit/Extensions/iLifeSlideshows.appex";
type = 0;
};
}

Regards
 
  • Like
Reactions: Brian33
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.