X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=c%2Fgoertzel%2Fsleepplot.sh;h=ea0bac2ac296b138c7aedc24b22e46826723b3d4;hb=3afb9fca6a37d4deea62d7b894fb953e8b538614;hp=0e8ed5eef79f0beb99379187a905f1e2100ecb91;hpb=e4016aeb50a60cdbc8e066999e13f5147e58d071;p=mirrors%2FPrograms.git diff --git a/c/goertzel/sleepplot.sh b/c/goertzel/sleepplot.sh index 0e8ed5e..ea0bac2 100755 --- a/c/goertzel/sleepplot.sh +++ b/c/goertzel/sleepplot.sh @@ -10,11 +10,11 @@ graphout="${in%%.*}.png" test -n "$2" && graphout="$2"; #Last state -last="$(tail -n 1 "$in" | cut -d ' ' -f 4)" +last="$(tail -n 1 "$in" | cut -d ' ' -f 5)" test "$last" -gt 0 && last="motion" || last="peace"; #Approximate size of graph -size="$(tail -n 1 "$in" | cut -d . -f 1)" +size="$(tail -n 1 "$in" | cut -d . -f 1 | sed -e 's/^0*//' | tee /tmp/lol)" test $size -gt 3600 && size="$(( $size/10 ))" #For prolonged periods size="$(( 600 + $size ))"