snipt

Ctrl+h for KB shortcuts

Bash

Get Mac idle time in milliseconds

ioreg -c IOHIDSystem | grep HIDIdleTime | head -1 | sed 's/[^0-9]//g; s,$,/1000000,' | bc
https://snipt.net/embed/4c5e329e8f34ed3f7c0209a4ae0428b3/
/raw/4c5e329e8f34ed3f7c0209a4ae0428b3/
4c5e329e8f34ed3f7c0209a4ae0428b3
bash
Bash
1
2019-08-17T21:12:06
True
False
False
Dec 16, 2012 at 08:24 PM
/api/public/snipt/51926/
get-mac-idle-time-in-milliseconds
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>ioreg -c IOHIDSystem <span class="p">|</span> grep HIDIdleTime <span class="p">|</span> head -1 <span class="p">|</span> sed <span class="s1">&#39;s/[^0-9]//g; s,$,/1000000,&#39;</span> <span class="p">|</span> bc </span></pre></div> </td></tr></table>
cli, mac