Skip to content

Same wm_classes in tabs otherwise new window #12

Answered by aravinda0
ckotyrba asked this question in Q&A
Discussion options

You must be logged in to vote

Here's a hacked up layout customization that defaults to splits and groups same-wm-class items as subtabs:

from qtile_bonsai.core.nodes import SplitContainer


class AutoGroupBonsai(Bonsai):
    def _handle_add_client__normal(self, window):
        """Sort of equivalent to overriding `Layout.add_client()`, which we don't do
        directly since we want to let it take care of post-config-reload state
        restoration etc.
        """
        if self._tree.is_empty:
            return self._tree.tab()

        existing_similar = self._find_existing_similar_pane(window)
        if existing_similar is not None:
            new_level = True

            # If the similar window is already …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ckotyrba
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants