4 echo "Usage: $0 sleeplog.txt"
10 cat "$1" | cut
-f 2,5 | cut
-d ' ' -f 1 |
grep '1$' |
while read line
; do
11 time=$
(echo $line | cut
-d ' ' -f 1);
12 time=$
(( $time + $seconds - $time%$seconds ))
14 done |
uniq -c |
sed -e 's/^\s*//g' |
tr ' ' '\t' > "$1.counts"
17 #Approximate size of graph
18 size
="$(tail -n 1 "$1" | cut -d . -f 1)"
19 test $size -gt 3600 && size
="$(( $size/10 ))" #For prolonged periods
20 size
="$(( 600 + $size ))"
25 set terminal png size $size,300
27 set title "Sleep motions"
35 #set format x "%H:%M:%S"
40 plot "$1" using 2:5 with steps, "$1.counts" using 2:(\$1/7) with lines
This page took 0.487396 seconds and 4 git commands to generate.