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
  • Select an option

  • Save kimsyversen/11674585e631290f27a3 to your computer and use it in GitHub Desktop.

Select an option

Save kimsyversen/11674585e631290f27a3 to your computer and use it in GitHub Desktop.

Revisions

  1. @Neil-Smithline Neil-Smithline created this gist Mar 18, 2012.
    4 changes: 4 additions & 0 deletions idletime.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    #!/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}'