from libqtile import bar from libqtile.widget.groupbox import GroupBox from libqtile.log_utils import logger class KuroBar(bar.Bar): defaults = [ ("background", "#000000", "Background colour."), ("background_normal", "#000000", "Background colour normally."), ("background_hover", "#000000", "Background colour on hover."), ("opacity", 1, "Bar window opacity."), ("margin", 0, "Space around bar as int or list of ints [N E S W]."), ("border_color", "#000000", "Border colour as str or list of str [N E S W]"), ("border_width", 0, "Width of border as int of list of ints [N E S W]"), ( "reserve", True, "Reserve screen space (when set to 'False', bar will be drawn above windows).", ), ] def process_pointer_enter(self, x: int, y: int) -> None: super().process_pointer_enter(x=x, y=y) self.background = self.background_hover # GroupBox Widget background color for widget in self.widgets: if isinstance(widget, GroupBox): if len(widget.highlight_color) in [6, 7]: widget.highlight_color = widget.highlight_color + "FF" else: widget.highlight_color = widget.highlight_color[:-2] + "FF" logger.warning(f"Highlight: {widget.highlight_color}") self.drawer.clear(self.background) self.draw() def process_pointer_leave(self, x: int, y: int) -> None: super().process_pointer_leave(x=x, y=y) self.background = self.background_normal # GroupBox Widget background color for widget in self.widgets: if isinstance(widget, GroupBox): if len(widget.highlight_color) in [6, 7]: widget.highlight_color = widget.highlight_color + "88" else: widget.highlight_color = widget.highlight_color[:-2] + "88" logger.warning(f"Highlight: {widget.highlight_color}") self.drawer.clear(self.background) self.draw()