How can I show the remaining time for a caffeinate command?
pmset -g assertions
will show the caffeinate
-generated assertion (among others) along with how many seconds remain:
pid 23694(caffeinate): [0x0013076c0005a0ed] 00:37:55 PreventUserIdleDisplaySleep named: "caffeinate command-line tool"
Details: caffeinate asserting for 7200 secs
Localized=THE CAFFEINATE TOOL IS PREVENTING SLEEP.
Timeout will fire in 4924 secs Action=TimeoutActionRelease