Skip to content

Instantly share code, notes, and snippets.

@mrkeuz
Forked from Neil-Smithline/idletime.sh
Created April 18, 2016 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrkeuz/b3ba94a189cbca6bbefbc6ccf6ecd0d9 to your computer and use it in GitHub Desktop.
Save mrkeuz/b3ba94a189cbca6bbefbc6ccf6ecd0d9 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