mac script to prevent sleep due to inactivity
https://github.com/ctcpip/cronch.sh.git
mac script to prevent sleep due to inactivity
CRONCH or NO CRONCH), and the idle time in seconds
$ ./cronch.sh
CRONCH will exit after 12 hours at Wed Jul 20 21:53:04 CDT 2022
Tue May 31 12:12:48 CDT 2022 -- NO CRONCH -- 0
Tue May 31 12:13:47 CDT 2022 -- NO CRONCH -- 42
Tue May 31 12:14:46 CDT 2022 -- NO CRONCH -- 101
Tue May 31 12:15:45 CDT 2022 -- NO CRONCH -- 160
Tue May 31 12:16:44 CDT 2022 -- CRONCH -- 219
Tue May 31 12:17:43 CDT 2022 -- NO CRONCH -- 59
modify the variables at the top of the script to your liking:
idleTimeoutMinutes=3 # {minutes} - how long to wait before sending keystroke to prevent sleep (and reset idle time (HIDIdleTime))
scriptTimeoutHours=12 # {hours} - when to stop running as a failsafe in case we forgot to stop this script manually
key=60 # {keycode} - keycode to send (60 is right shift)
you can also specify scriptTimeoutHours as an argument. for example:
$ ./cronch.sh 3
CRONCH will exit after 3 hours at Wed Jul 20 12:53:18 CDT 2022
for long running tests, the system going to sleep or being idle for a long time can interrupt the test run, or affect test performance. this script prevents that.
no particular reason. gotta call the script something. might as well be the sound of a gator chomping down on something.
GPL-3.0