"""bar.py------This module provides classes to manage bar settings for Qtile.Classes: AppSettingsBarWidget: Manages individual bar widget settings. AppSettingsBar: Manages bar settings including position, size, margin, and widgets."""fromtypingimportList
[docs]classAppSettingsBarWidget:type:str=""args:dict={}def__init__(self,**kwargs):""" Initializes the AppSettingsBarWidget with optional keyword arguments. Args: **kwargs: Arbitrary keyword arguments to initialize the bar widget settings. """self.type=kwargs.pop("type",self.type)self.args=kwargs
[docs]classAppSettingsBar:position:str="top"size:int=32margin:List[int]=[8,8,0,8]widgets:List[AppSettingsBarWidget]=[]def__init__(self,**kwargs):""" Initializes the AppSettingsBar with optional keyword arguments. Args: **kwargs: Arbitrary keyword arguments to initialize the bar settings. """self.position=kwargs.get("position",self.position)self.size=int(kwargs.get("size",str(self.size)))self.widgets=[AppSettingsBarWidget(**w)forwinkwargs.get("widgets",[])]margin=kwargs.get("margin")ifmargin:margin=margin.split(",")self.margin=[int(i)foriinmargin]