def mode_changed(self, layout):
        """Update text depending on add_mode of layout."""
        if not isinstance(layout, plasma.Plasma):
            self.update("")
            self._layout = None
            return

        self._layout = layout

        if layout.group and layout.group.screen is not self.bar.screen:
            return

        if layout.horizontal:
            if layout.split:
                mode = self.horizontal_split
                self._mode = AddMode.HORIZONTAL | AddMode.SPLIT
            else:
                mode = self.horizontal
                self._mode = AddMode.HORIZONTAL
        else:
            if layout.split:
                mode = self.vertical_split
                self._mode = AddMode.VERTICAL | AddMode.SPLIT
            else:
                mode = self.vertical
                self._mode = AddMode.VERTICAL

        self.update(self.format.format(mode=mode))
Update text depending on add_mode of layout.
libqtile/widget/plasma.py