9951 explained code solutions for 126 technologies


ubuntuHow to get battery status in CLI


upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage"ctrl + c
upower

utility to show info on power devices

-i

shows detailed info on specified power source

upower -e | grep 'BAT'

will fetch battery power source name (if any)

grep -E

show only battery state and percentage