Skip to content

Instantly share code, notes, and snippets.

@kimsyversen
Forked from Neil-Smithline/idletime.sh
Created October 1, 2015 19:20
Show Gist options
  • Save kimsyversen/11674585e631290f27a3 to your computer and use it in GitHub Desktop.
Save kimsyversen/11674585e631290f27a3 to your computer and use it in GitHub Desktop.
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