From aceb8340357347d68b5b96b778e3a928bcdd3c5e Mon Sep 17 00:00:00 2001 From: spv Date: Sun, 23 Nov 2025 13:47:37 -0500 Subject: add `sb` for summation, fixup ROADMAP --- src/process.py | 15 --------------- src/sb | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) delete mode 100755 src/process.py create mode 100755 src/sb (limited to 'src') diff --git a/src/process.py b/src/process.py deleted file mode 100755 index 0b645b8..0000000 --- a/src/process.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os - -def main(argv): - homedir = os.getenv("HOME") - stroke_buddydir = homedir + "/.local/stroke_buddy" - log_files = os.listdir(stroke_buddydir) - - print(log_files) - - return 0 - -if __name__ == "__main__": - sys.exit(main(sys.argv)) 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) -- cgit v1.2.3