How to get the CPU temperature?

Getting the CPU temperature from command line can be achieved with:

printf '%d°\n' $(sensors | grep 'id 0:' | awk '{ print $4 }') 2>/dev/null
# 55°
Continue reading...

How to get the battery status from command line?

We can echo battery percentage with the following command:

upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage" | awk '/perc/{print $2}'
# 65%
Continue reading...