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