CentOS 7.x check laptop battery information

From Notes_Wiki
Revision as of 06:41, 12 June 2017 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>CentOS_7.x_laptop_battery|CentOS 7.x laptop battery</yambe:breadcrumb> =CentOS 7.x check laptop battery information= To check laptop battery related informa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>CentOS_7.x_laptop_battery|CentOS 7.x laptop battery</yambe:breadcrumb>

CentOS 7.x check laptop battery information

To check laptop battery related information use:

      upower -i /org/freedesktop/UPower/devices/battery_BAT0      


To get laptop battery information via alias create '/etc/profile.d/bat.sh' with

      #!/bin/bash

      alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'

Then use:

chmod +x /etc/profile.d/bat.sh

to make the profile configuration script executable. Then to check battery information simply use:

bat

after starting a new shell.

Refer: