Commit 9564a520 authored by Piotr "PHT" Jasiek's avatar Piotr "PHT" Jasiek

Add battery power percentage

parent d86b8bda
......@@ -20,6 +20,6 @@ def get_cpu_temp():
cpu_temp = popen("sensors dell_smm-virtual-0 | grep -i CPU | awk {'print $2'} | sed -e 's/°C//g' | sed -e 's/+//g'").read()
return cpu_temp
#def get_battery_percent():
# battery_percent = sensors_battery().percent
# return battery_percent
def get_battery_percent():
battery_percent = popen("upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i 'percentage' | awk {'print $2'} | sed -e 's/%//g'")
return battery_percent
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment