View Single Post
Posts: 233 | Thanked: 170 times | Joined on Nov 2009 @ Finland
#11
Originally Posted by j.s View Post
I woud like to know where to find power usage info myself. (Been using unix shells for over 20 years.)
Try lshal | grep battery

The lshal -command gives one item that is battery.charge_level.percentage. I wrote a quick shell script for fetching just the percentage from it:

lshal | grep battery.charge_level.percentage | awk '{print $3}'

I put it in /usr/bin/bat using vi and chmodded it 755. Now I can write "bat" anywhere in the terminal and get the batterylevel.

Too bad it only works when your device is not charging. When it's connected to a charger it shows 0.
 

The Following 3 Users Say Thank You to jaysire For This Useful Post: