-
-
Save jcla1/6522769 to your computer and use it in GitHub Desktop.
Revisions
-
jcla1 revised this gist
Sep 14, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # initially by Jehiah Czebotar. Modified by Joseph Adams FILE="data/misc/activity_log/`date +%Y%m%d`.log" FRONT_APP="data/misc/cron/frontApp/frontApp.applescript" function log_activity() { -
jcla1 revised this gist
Sep 14, 2013 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,15 @@ #!/bin/sh # computer activity data collection for http://jehiah.cz/one-two/ # initially by Jehiah Czebotar. Modified by Joseph Adams FILE="data/misc/activity_log/`date +%Y%m%d`.log" FRONT_APP="data/misc/cron/activity_snapshot/frontApp.applescript" function log_activity() { local UTC=`date "+%s,%Z"` local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 )) local ACTIVE_PROGRAM=$(/usr/bin/osascript $FRONT_APP) echo "$UTC,$IDLE,$ACTIVE_PROGRAM" >> $FILE } -
jcla1 revised this gist
Sep 14, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ tell application "System Events" name of first application process whose frontmost is true end tell -
jcla1 revised this gist
Sep 13, 2013 . 2 changed files with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,13 @@ # computer activity data collection for http://jehiah.cz/one-two/ # by Jehiah Czebotar FILE="data/misc/activity_log/`date +%Y%m%d`.log" function log_activity() { local UTC=`date "+%s,%Z"` local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 )) local ACTIVE_PROGRAM=$(/usr/bin/osascript frontApp.applescript) echo "$UTC,$IDLE,$ACTIVE_PROGRAM" >> $FILE } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ tell application "System Events" set frontApp to name of first application process whose frontmost is true end tell -
jcla1 revised this gist
Sep 11, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
Empty file. -
jcla1 revised this gist
Sep 11, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # computer activity data collection for http://jehiah.cz/one-two/ # by Jehiah Czebotar FILE="../activity_log/`date +%Y%m%d`.log" function log_activity() { @@ -15,4 +15,4 @@ function log_activity() log_activity sleep 30 log_activity -
jehiah created this gist
Jan 7, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/bin/sh # computer activity data collection for http://jehiah.cz/one-two/ # by Jehiah Czebotar FILE="activity_log/`date +%Y%m%d`.log" function log_activity() { local UTC=`date "+%s,%Z"` local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 )) local ACTIVE_PROGRAM=$(/usr/bin/osascript -e 'tell application "System Events"' -e 'set frontApp to name of first application process whose frontmost is true' -e 'end tell') echo "$UTC,$IDLE,$ACTIVE_PROGRAM" >> $FILE } log_activity sleep 30 log_activity