Idle Time and Inactivity on macOS
How idle time on macOS works and how it affects the inactivity trigger.
On macOS, Power Manager’s inactivity trigger is based on the operating system’s Human Interface Device (HID) idle time counter. You can watch this counter change using one of the Terminal.app commands below.
For zsh
, the default macOS shell, run:
repeat 3600 { echo $(date) "-" $((`ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'`/1000000000)) "seconds idle"; sleep 1 }
For bash
, the legacy macOS shell, run:
for i in {1..3600}; do echo $(date) "-" $((`ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'`/1000000000)) "seconds idle"; sleep 1; done
To use the command above, copy and paste the single line into Terminal.app and press enter. Then watch the idle time tick up. For one hour, command prints the current HIDIdleTime
value every second:
Thu Jul 24 10:28:47 CEST 2025 - 0 seconds idle
Thu Jul 24 10:28:48 CEST 2025 - 1 seconds idle
Thu Jul 24 10:28:49 CEST 2025 - 2 seconds idle
Thu Jul 24 10:28:50 CEST 2025 - 3 seconds idle
Thu Jul 24 10:28:51 CEST 2025 - 4 seconds idle
Thu Jul 24 10:28:52 CEST 2025 - 5 seconds idle
Thu Jul 24 10:28:54 CEST 2025 - 0 seconds idle
Thu Jul 24 10:28:55 CEST 2025 - 1 seconds idle
Thu Jul 24 10:28:56 CEST 2025 - 0 seconds idle
Thu Jul 24 10:28:57 CEST 2025 - 0 seconds idle
…
Try moving the cursor or pressing a key. The period of inactivity immediately resets to 0.
Periods of 0 seconds idle are expected. These are periods of continuous activity.
You can leave the Terminal.app window open in the background and work as usual. The command will continue for 3,600 seconds (60 minutes).
On macOS, Power Manager’s inactivity trigger is based on this counter.
You can see Power Manager’s calculations and behaviour by enabling debug logging. Once debugging logging is enabled, Power Manager’s log file includes each time an inactivity trigger examines the HID idle time and compares the value against the desired period of inactivity.
Be aware that connected hardware and other software may reset the HIDIdleTime
value to zero. macOS’s idle time involves more that just counting the seconds of user’s inactivity.
Reaching a few minutes to fifteen minutes of inactivity should be possible in most situations. We recommend avoiding inactivity triggers requiring long periods of inactivity. They are unlikely to be triggered.