Control: tags -1 + patch
[Didier 'OdyX' Raboud]
> Hi,
Hi, and thank you for the bug report.
> I haven't investigated further, but this might be caused by having
> only one single line in the log.
Is it working better once you have something in the log?
I believe this patch will solve the problem. I'm pushing it upstream.
diff --git a/src/battery-graph.in b/src/battery-graph.in
index a61cdec..bb5cb62 100644
--- a/src/battery-graph.in
+++ b/src/battery-graph.in
@@ -172,11 +172,14 @@ TIME_LAST_DISCHARGE_BEGIN=`awk "BEGIN {last_status=-1} \
{ if (\\\$3!=last_status && \\\$3==1) {tchange = \\\$1} last_status=\\\$3 } \
END {print (tchange)}" $TMPFILENAME`
-TIME_LAST_DISCHARGE_END=`awk "BEGIN {last_status=-1} \
+if [ ! "$TIME_LAST_RECORD" ] ; then
+ SWITCH_RATE=false
+else
+ TIME_LAST_DISCHARGE_END=`awk "BEGIN {last_status=-1} \
{ if (\\\$3!=last_status && \\\$3==2) {tchange = \\\$1} last_status=\\\$3 } \
END { if (tchange>$TIME_LAST_DISCHARGE_BEGIN) {print (tchange)}
else {print $TIME_LAST_RECORD} }" $TMPFILENAME`
-
+fi
ZERO_BIOS_ESTIMATE=`tail -n 1 $TMPFILENAME | awk '{ print $6 }'`
--
Happy hacking
Petter Reinholdtsen