aboutsummaryrefslogtreecommitdiff
path: root/src/sb
diff options
context:
space:
mode:
Diffstat (limited to 'src/sb')
-rwxr-xr-xsrc/sb21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sb b/src/sb
new file mode 100755
index 0000000..a3bc968
--- /dev/null
+++ b/src/sb
@@ -0,0 +1,21 @@
+#!/usr/bin/env zsh
+
+STROKE_BUDDY_DIR=~/.local/stroke_buddy
+TODAY=`date -I`
+
+function count_for_date {
+ lines=0
+
+ for hourly_file in $STROKE_BUDDY_DIR/"$1"*; do
+ hourly_presses=$(cat $hourly_file \
+ | grep keypresses \
+ | cut -d',' -f2)
+
+ lines=$(($lines+$hourly_presses))
+# lines=$(($lines+$hourly));
+ done
+
+ echo $lines
+}
+
+echo $(count_for_date $TODAY)