X-Git-Url: http://git.scottworley.com/keystroke-timestamps/blobdiff_plain/327688da2c74edb33dca2d4c04d2bab91f2e46fd..2ecebf75f7fd4624e55958b9892d370b36fab220:/gaps.sh?ds=sidebyside diff --git a/gaps.sh b/gaps.sh index 46a05cc..7f8de73 100755 --- a/gaps.sh +++ b/gaps.sh @@ -1,13 +1,10 @@ -#!/bin/bash +#!/bin/sh threshold=${1:-3600} -LOGFILE="$HOME/keystroke-timestamps.log" +LOGFILE="${2:-$HOME/keystroke-timestamps.log}" -awk -vthreshold="$threshold" ' - BEGIN { - time_fmt = "%F %T" - } - { +awk -vthreshold="$threshold" -vtime_fmt="%F %T" ' + $1 <= 67767976233561595 { if (prev && $1 - prev > threshold) { print(strftime(time_fmt, prev), "to", strftime(time_fmt, $1), "was", $1 - prev) }