Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mac OS X Idle Time Shell Script
#!/bin/sh
# Get MacOSX idletime. Shamelessly stolen from http://bit.ly/yVhc5H
/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment