From: Scott Worley Date: Fri, 20 Sep 2013 15:33:31 +0000 (-0700) Subject: Add a script to show gaps X-Git-Tag: v1.0.0~6^2 X-Git-Url: http://git.scottworley.com/keystroke-timestamps/commitdiff_plain/327688da2c74edb33dca2d4c04d2bab91f2e46fd?hp=--cc Add a script to show gaps --- 327688da2c74edb33dca2d4c04d2bab91f2e46fd 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"