def get_battery_info(self): battery = psutil.sensors_battery() if battery: percent = battery.percent is_charging = battery.power_plugged return percent, is_charging return None, None
Right-click the taskbar and select Taskbar settings . Scroll to the "Notification area" and click Select which icons appear on the taskbar . Locate Power and switch it to On . add battery icon to taskbar
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] "HideSCABattery"=dword:00000000 def get_battery_info(self): battery = psutil
# Run icon self.icon.run()