diff --git a/src/core/widgets/yasb/battery.py b/src/core/widgets/yasb/battery.py index a97273e..1cb6509 100644 --- a/src/core/widgets/yasb/battery.py +++ b/src/core/widgets/yasb/battery.py @@ -176,6 +176,11 @@ def _update_label(self): # Ensure the icon is correctly set icon = re.sub(r'|', '', battery_status).strip() active_widgets[widget_index].setText(icon) + icon = re.sub(r'|', '', battery_status).strip() + active_widgets[widget_index].setText(icon) + existing_classes = active_widgets[widget_index].property("class") + new_classes = re.sub(r'status-\w+', '', existing_classes).strip() + active_widgets[widget_index].setProperty("class", f"{new_classes} status-{threshold}") else: alt_class = "alt" if self._show_alt_label else "" formatted_text = battery_status.format(battery_status)