]> git.scottworley.com Git - keystroke-timestamps/blob - gaps.sh
Include the `fill-in` helper script here
[keystroke-timestamps] / gaps.sh
1 #!/bin/sh
2
3 set -e
4
5 threshold=${1:-3600}
6 LOGFILE="${2:-$HOME/keystroke-timestamps.log}"
7
8 awk -vthreshold="$threshold" -vtime_fmt="%F %T" '
9 $1 <= 67767976233561595 {
10 if (prev && $1 - prev > threshold) {
11 print(strftime(time_fmt, prev), "to", strftime(time_fmt, $1), "was", $1 - prev)
12 }
13 prev = $1
14 }' "$LOGFILE"