From 8490fed7bcbcd95194ca05583b460f41b53912e1 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 9 Jul 2021 20:18:53 +0200 Subject: [PATCH] i3-companion: don't display layout for leaves, it does not make sense If we change the direction of a window, this creates a new container. I don't think layout is used at all for windows. --- bin/i3-companion | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/i3-companion b/bin/i3-companion index 6709829..d5bcef2 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -287,14 +287,18 @@ async def workspace_info(i3, event): else: if container.focused: style = 'foreground="#ffaf00"' - else: + elif not container.window: style = 'foreground="#6c98ee"' + else: + style = '' + if container.window: + content = (f"{(container.window_class or '???').lower()}: " + f"{(container.window_title or '???')}") + else: + content = f"({container.layout})" root = (f"" - f"({container.layout})" + f"{content.lower()}" "") - if container.window_title: - root += (f" {html.escape(container.window_class.lower())}:" - f" {html.escape(container.window_title)}") children = [] for child in container.nodes: if child == container.nodes[-1]: