From e1beb78bfe9176b28f6edfd9b56e8df6da0edfc3 Mon Sep 17 00:00:00 2001 From: redxef Date: Fri, 28 Oct 2022 21:47:24 +0200 Subject: [PATCH] Fix ipc command generation. --- i3toolwait | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/i3toolwait b/i3toolwait index ee90a29..420c4fa 100755 --- a/i3toolwait +++ b/i3toolwait @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- +import collections.abc import asyncio import functools import json @@ -280,7 +281,7 @@ def window_new(configs: list[dict], debug: bool): if filter.reduce(e.ipc_data): container_id = e.ipc_data['container']['id'] await ipc.command(f'for_window [con_id="{container_id}"] focus') - await ipc.command(f'for_window [con_id="{container_id}"] move container to workspace {workspace}') + await ipc.command(f'move container to workspace {workspace}') configs.pop(i) if not configs: ipc.main_quit() @@ -294,7 +295,7 @@ async def run(configs: list[dict], *, timeout: int, debug: bool): for cfg in configs: cfg['filter'] = parse(cfg['filter']) p = cfg['program'] - if isinstance(p, list): + if isinstance(p, collections.abc.Iterable): p = ' '.join(p) coroutines += [ipc.command(f'exec {p}')] await asyncio.gather(*coroutines)