Sudev Ambadi

I'm a computer enthusiast interested in exploring Free and Open software, operating systems, cloud computing, programming and cricket.

Twitter Facebook Instagram Github

Battery information inside terminal

If you want to know your battery details in terminal use upower and create an alias to it. Helpful if you are using any window manager without proper GUI.

To view battery details using upower

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

Grep to view only the required details

 
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|time|per"

Create an alias

 
alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|time|per"'

Add alias to ~/.bashrc file and make it permemanent.


comments powered by Disqus