View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#35
Hi,
built-in "Battery(mAh)" command seems a bit buggy on my N900 after upgrading to PR 1.1.
It seems that "hal-device" command outputs battery reporting lines with different sort order thus making "Battery(mAh)" |-ed awk commands miss the "current" value.

Display at end of widget's status line was:
Code:
/1261
UPDATE 201001160912:
It seems that sort order of "hal-device" command output is quite random depending on unknown external conditions (I had the N900 connected in Storage Mode to the PC and output sort order was different than N900 not being connected)
I believe all shell/awk scripts relying on "hal-device" positional parameters output could be affected by this behaviour.

To make "Battery(mAh)" command work again I had to change it like this:
Code:
hal-device | grep battery.reporting | awk -F. '{print $3}' | sort | awk '$1 == "current" { current = $3}; $1== "design" {print current "/" $3}'

Last edited by No!No!No!Yes!; 2010-01-16 at 08:19.
 

The Following 2 Users Say Thank You to No!No!No!Yes! For This Useful Post: