ioreg -c IOHIDSystem | perl -lane 'if(/Idle/) {print $F[-1]/1000000000 +; last;}'
Update: cleaned up that link's Perl version a bit.
In reply to Re: Detecting idle time on Mac
by Fletch
in thread Detecting idle time on Mac
by sgifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |