Battery and power status on your CentOS Linux laptop
The upower cli tool will get you a large amount of information about power and batteries in your system. Install upower using the command
yum -y install upower
To enumerate the devices upower can get information about on your system with the command
upower -e
On my system I get:
/org/freedesktop/UPower/devices/line_power_AC /org/freedesktop/UPower/devices/battery_BAT0 /org/freedesktop/UPower/devices/DisplayDevice
To check the battery, use the correct device from above as follows:
$upower -i /org/freedesktop/UPower/devices/battery_BAT0
native-path: BAT0
vendor: Notebook
model: BAT
serial: 0001
power supply: yes
updated: Tue 05 Sep 2017 11:28:45 AM EDT (62 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: charging
warning-level: none
energy: 66.8331 Wh
energy-empty: 0 Wh
energy-full: 67.7433 Wh
energy-full-design: 62.16 Wh
energy-rate: 4.0293 W
voltage: 12.89 V
time to full: 13.6 minutes
percentage: 98%
capacity: 100%
technology: lithium-ion
icon-name: 'battery-full-charging-symbolic'
History (rate):
1504625325 4.029 charging
As you can see after ~ 2 years of extensive use, my battery is in pretty good shape:
upower can also get information about your external keyboard’s battery (if it supports it). I dont have a keyboard that supports it on my system
