frobar: Fix empty container name

This commit is contained in:
Geoffrey Frogeye 2025-01-10 22:18:07 +01:00
parent 9adfcd2377
commit d6e95da9dc
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -42,7 +42,10 @@ class I3WindowTitleProvider(SingleSectionProvider):
# TODO FEAT To make this available from start, we need to find the
# `focused=True` element following the `focus` array
def on_window(self, i3: i3ipc.Connection, e: i3ipc.Event) -> None:
self.section.setText(clip(e.container.name, 60))
if e.container.name is None:
self.section.setText(None)
else:
self.section.setText(clip(e.container.name, 60))
async def run(self) -> None:
await super().run()