From 327688da2c74edb33dca2d4c04d2bab91f2e46fd Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Fri, 20 Sep 2013 08:33:31 -0700 Subject: [PATCH] Add a script to show gaps --- gaps.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 gaps.sh 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" -- 2.51.2