Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Gabriel Zachmann via Cocoa-dev
Thanks for the hint. Can caffeinate be run such that it prevents ONLY the screensaver from kicking in, but does NOT prevent the system from sleeping? (I could not find that option in the man page.) Best regards, Gabriel > On 29. Jun 2020, at 04:28, じょいすじょん wrote: > > One way to do this is w

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Gabriel Zachmann via Cocoa-dev
> but the header for that function says it can be replaced by > IOPMAssertionCreateWithName(). I haven’t looked at that in detail or used it > myself, but one of the defines for that function is > ‘kIOPMAssertionTypePreventUserIdleDisplaySleep’, which appears to do the same > thing as the old

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread じょいすじょん via Cocoa-dev
> On Jun 29, 2020, at 15:24, Sandor Szatmari > wrote: > > > >> On Jun 28, 2020, at 22:29, じょいすじょん via Cocoa-dev >> wrote: >> >> One way to do this is with the command line tool: >> caffeinate >> >> You could run a background task that starts it with something like >> caffeinate -dimsu

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Sandor Szatmari via Cocoa-dev
> On Jun 28, 2020, at 22:29, じょいすじょん via Cocoa-dev > wrote: > > One way to do this is with the command line tool: > caffeinate > > You could run a background task that starts it with something like > caffeinate -dimsu > > You can probably also find its source code on opensource.apple.com t

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread じょいすじょん via Cocoa-dev
One way to do this is with the command line tool: caffeinate You could run a background task that starts it with something like caffeinate -dimsu You can probably also find its source code on opensource.apple.com to understand what it does and how. Like here is a version: https://opensource.a

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Graham Cox via Cocoa-dev
In the “old days”, your app could periodically call UpdateSystemActivity( UsrActivity ) to prevent the screensaver kicking in. This has been deprecated since 10.8, but the header for that function says it can be replaced by IOPMAssertionCreateWithName(). I haven’t looked at that in detail or use

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Sandor Szatmari via Cocoa-dev
G, > On Jun 28, 2020, at 15:31, Gabriel Zachmann wrote: > >  >>> Does anyone know how to programmatically disable macOS from launching the >>> screen saver on macOS? >>> I would like to do that in one of my apps. >> >> Not sure in general, but in a managed host situation this type of system

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Gabriel Zachmann via Cocoa-dev
>> Does anyone know how to programmatically disable macOS from launching the >> screen saver on macOS? >> I would like to do that in one of my apps. > > Not sure in general, but in a managed host situation this type of system > modification could be disallowed by policy. Even admin users of a