Sometimes the energy status applet on my gnome panel suddenly disappears.
Is there a simple command to print loading state of the battery at commandline?
There are different methods for this:
First, you could install the package acpi and run it like to:
It will show you the battery's current capacity and if it's charging, discharging and how long it will last/take to be recharged if charging.
If you don't want to install new packages, there's also the proc filesystem to query:
for more details on your battery, check
Will give you the remaining capacity.
To check the maximum capacity, both last and designed.
Note that BAT0 is a name that can change between computer models.
You could execute
You can also install acpi
It's pretty easy to write a script to check the battery level stuff. When I was toying with ruby I wrote one here:
It does require the gem for ansi/code for the coloring at the terminal.
This is kind of a bash alternative that I used at one time:
The stuff with the BAT0 vs BAT1 is that on my laptop I had a second battery in the DVD drive bay so there were actually two to check.