15 lines
351 B
Python
15 lines
351 B
Python
|
from theme import current_theme, default
|
||
|
|
||
|
try:
|
||
|
charge = open("/sys/class/power_supply/BAT1/capacity").read().strip()
|
||
|
status = open("/sys/class/power_supply/BAT1/status").read().strip()
|
||
|
|
||
|
if status == "Discharging":
|
||
|
icon = ""
|
||
|
else:
|
||
|
icon = ""
|
||
|
|
||
|
content = f"{icon}{status}%"
|
||
|
except Exception:
|
||
|
content = None
|