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.
This commit is contained in:
Vincent Bernat 2021-07-09 20:18:53 +02:00
parent 47d4fc848c
commit 8490fed7bc

View file

@ -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"<span {style}>"
f"({container.layout})"
f"{content.lower()}"
"</span>")
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]: