From c1117ba3436459066aeb70226e61d504aa92637e Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 5 Jul 2021 15:02:30 +0200 Subject: [PATCH] Revert "i3-companion: tentative to display workspace layout" This reverts commit c3f12f311faf8937e651a17363b544e2a10a0feb. --- bin/i3-companion | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/bin/i3-companion b/bin/i3-companion index 78b23e1..0c1423b 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -110,43 +110,6 @@ def workspace_rename(i3, event): i3.command(';'.join(commands)) -workspace_layouts = { - "splith": "", - "splitv": "", - "stacked": "", - "tabbed": "", -} - - -def workspace_layout(i3, event): - uid = os.getuid() - if hasattr(event, 'payload') and event.payload != 'ws-layout-change': - return - workspaces = i3.get_tree().workspaces() - for w in i3.get_workspaces(): - if not w.visible: - continue - layout = None - for ow in workspaces: - if w.num == ow.num: - layout = workspace_layouts.get(ow.layout, "?").encode('utf-8') - break - if layout is None: - continue - logger.debug(f"workspace {w.num} layout {ow.layout}") - fifo = f"/run/user/{uid}/i3/ws-{w.output}" - try: - fd = os.open(fifo, os.O_WRONLY | os.O_NONBLOCK) - try: - os.write(fd, layout + b"\n") - finally: - os.close(fd) - except (FileNotFoundError, BrokenPipeError, OSError): - logger.warning(f"workspace {w.num} layout {ow.layout} " - f"but not able to send to {fifo}") - continue - - if __name__ == "__main__": options = parse_args() setup_logging(options) @@ -160,12 +123,6 @@ if __name__ == "__main__": Event.WINDOW_CLOSE}: i3.on(event, workspace_rename) - # Update current workspace layout - for event in {Event.WORKSPACE_INIT, - Event.WORKSPACE_FOCUS, - Event.TICK}: - i3.on(event, workspace_layout) - i3.main() except Exception as e: logger.exception("%s", e)