def register_widget(self, w: _Widget) -> None:
        """
        Register a bar widget

        If a widget with the same name already exists, the new widget will be
        automatically renamed by appending numeric suffixes. For example, if
        the widget is named "foo", we will attempt "foo_1", "foo_2", and so on,
        until a free name is found.

        This naming convention is only used for qtile.widgets_map as every widget
        MUST be registered here to ensure that objects are finalised correctly.

        Widgets can still be accessed by their name when using
        lazy.screen.widget[name] or lazy.bar["top"].widget[name] unless there are
        duplicate widgets in the bar/screen.

        A warning will be provided where renaming has occurred.
        """
        # Find unoccupied name by appending numeric suffixes
        name = w.name
        i = 0
        while name in self.widgets_map:
            i += 1
            name = f"{w.name}_{i}"

        if name != w.name:
            self.renamed_widgets.append(name)

        self.widgets_map[name] = w

        Register a bar widget

        If a widget with the same name already exists, the new widget will be
        automatically renamed by appending numeric suffixes. For example, if
        the widget is named "foo", we will attempt "foo_1", "foo_2", and so on,
        until a free name is found.

        This naming convention is only used for qtile.widgets_map as every widget
        MUST be registered here to ensure that objects are finalised correctly.

        Widgets can still be accessed by their name when using
        lazy.screen.widget[name] or lazy.bar["top"].widget[name] unless there are
        duplicate widgets in the bar/screen.

        A warning will be provided where renaming has occurred.
        
libqtile/core/manager.py