posible auto sample size?
[cheali-logview-gnuplot] / cheali-scope.sh
1 #!/bin/sh -xe
2
3 # .i3/config
4 # for_window[title="^Gnuplot"] floating enable
5
6 # http://users.softlab.ntua.gr/~ttsiod/gnuplotStreaming.html
7 test -x driveGnuPlots.pl || wget http://users.softlab.ntua.gr/~ttsiod/driveGnuPlots.pl && chmod 755 driveGnuPlots.pl
8
9 width=600
10 file=$1
11
12 test -z "$file" && file=`ls -t log/*.log | head -1`
13
14 echo "# using $width points from file $file"
15
16 #tail -f `ls -t log/*.log | head -1` \
17 cat $file \
18 | grep '$1' | cut -d\; -f \
19 4,5,6,\
20 10,11,\
21 12,13,14,15,16,17,\
22 18,19,20,21,22,23,\
23 24,25,26,27,28 \
24 | sed \
25 -e 's/^/0:/' \
26 -e 's/;/\n1:/' \
27 -e 's/;/\n2:/' \
28 -e 's/;/\n3:/' \
29 -e 's/;/\n4:/' \
30 -e 's/;/\n5:/' \
31 -e 's/;/\n6:/' \
32 -e 's/;/\n7:/' \
33 -e 's/;/\n8:/' \
34 -e 's/;/\n9:/' \
35 -e 's/;/\n10:/' \
36 -e 's/;/\n11:/' \
37 -e 's/;/\n12:/' \
38 -e 's/;/\n13:/' \
39 -e 's/;/\n14:/' \
40 -e 's/;/\n15:/' \
41 -e 's/;/\n16:/' \
42 -e 's/;/\n17:/' \
43 -e 's/;/\n18:/' \
44 -e 's/;/\n19:/' \
45 -e 's/;/\n20:/' \
46 -e 's/;/\n21:/' \
47 -e 's/;/\n22:/' \
48 | ./driveGnuPlots.pl 22 \
49 $width $width $width \
50 $width $width \
51 $width $width $width $width $width $width \
52 $width $width $width $width $width $width \
53 $width $width $width $width $width \
54 V mA mAh \
55 temp Vinput, \
56 v1 v2 v3 v4 v5 v6, \
57 r1 r2 r3 r4 r5 r6, \
58 Rbat Rwire Z AA AB \
59 2>/dev/null
60
61 # leave empty line bove this one