From: Scott Worley Date: Fri, 4 Apr 2014 08:18:12 +0000 (-0700) Subject: Merge branch 'master' of https://github.com/chkno/keystroke-timestamps X-Git-Tag: v1.0.0~6 X-Git-Url: http://git.scottworley.com/keystroke-timestamps/commitdiff_plain/922ce0bc5c364f1eb9d824b9c221d899812a52ef?hp=aa11b409c9d3c3483b63830a0cf92660ca619009 Merge branch 'master' of https://github.com/chkno/keystroke-timestamps --- diff --git a/gaps.sh b/gaps.sh new file mode 100755 index 0000000..46a05cc --- /dev/null +++ b/gaps.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +threshold=${1:-3600} +LOGFILE="$HOME/keystroke-timestamps.log" + +awk -vthreshold="$threshold" ' + BEGIN { + time_fmt = "%F %T" + } + { + if (prev && $1 - prev > threshold) { + print(strftime(time_fmt, prev), "to", strftime(time_fmt, $1), "was", $1 - prev) + } + prev = $1 + }' "$LOGFILE" diff --git a/plot.gnuplot b/plot.gnuplot new file mode 100755 index 0000000..a8041ff --- /dev/null +++ b/plot.gnuplot @@ -0,0 +1,21 @@ +#!/usr/bin/gnuplot + +filename = "keystroke-timestamps.log" +bucket_size = 300 # Display resolution, in seconds +timezone_offset = -7 * 3600 # UTC-7, North American Pacific Daylight Time + +set timefmt "%s" +set xdata time +set grid +set autoscale fix +unset key + +plot "< awk '{ print int($1 / ".bucket_size.") }' \"".filename."\" \ + | uniq -c \ + | awk '{ print $2 * ".bucket_size.", $1 }' \ + | fill-in ".bucket_size \ + using ($1 + timezone_offset):2 with lines + +# (fill-in is https://chkno.net/fill-in ) + +pause -1 "Press enter to dismiss"