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