updates
authorDan White <dan@whiteaudio.com>
Sun, 16 May 2021 18:36:28 +0000 (13:36 -0500)
committerDan White <dan@whiteaudio.com>
Sun, 16 May 2021 18:36:28 +0000 (13:36 -0500)
TimeSampleHistogram
scan2pdf
timeSampler

index b32528b6dbfa48e134a20c17ba1a1bd66f7cd074..53df283079171f09889dd76063daf78a289a6efa 100755 (executable)
@@ -116,7 +116,7 @@ if isinstance(opt.daysago, int):
 
 # handle -d, --days option
 # if supplied, modify either startdate or enddate accordingly
-if opt.days > 0:
+if opt.days >= 0:
     enddate = startdate + dt.timedelta(opt.days)
 elif opt.days < 0:
     startdate = enddate + dt.timedelta(opt.days)
index cde86016b6661508574932c5b8b3b0198b8da61a..68b23214099ae4319005723ea3fdb755229a3129 100755 (executable)
--- a/scan2pdf
+++ b/scan2pdf
@@ -11,16 +11,23 @@ fi
 INFILE="$1"
 OUTFILE="$2"
 
+# no second argument
 if [ "$OUTFILE" = "" ]; then
     OUTFILE=${INFILE}.pdf
 fi
 
+# no .pdf for out name, add one
+SUFFIX="${OUTFILE##*.}"
+if [ "$SUFFIX" != "pdf" ]; then
+    OUTFILE="${OUTFILE}.pdf"
+fi
+
 
 convert \
     -density 300 \
     "$INFILE" \
     +dither \
-    -colors 64 \
+    -colors 32 \
     -black-threshold 50% \
     -fuzz 20% -fill white -opaque white \
     -extent 2550x3300 \
index b54236e58e1541a698b3bccaae49a74af83f60b2..37ad58ac6df01468fdb0b3c7976589cbe035ddf5 100755 (executable)
@@ -127,7 +127,9 @@ function sampleTask {
 
     echo "$DATE $ACTIVITY" >> $LOGFILE
     echo "$DATE $ACTIVITY"
-    echo "$HOSTNAME $DATE $ACTIVITY" >> $BACKUPFILE
+    cat <<EOF >> $BACKUPFILE
+{"user":"$USER@$HOSTNAME", "time": "$DATE", "activity":"$ACTIVITY"}
+EOF
 }