Fix ipc command generation.
This commit is contained in:
parent
6f4d9032b4
commit
e1beb78bfe
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
import collections.abc
|
||||||
import asyncio
|
import asyncio
|
||||||
import functools
|
import functools
|
||||||
import json
|
import json
|
||||||
|
@ -280,7 +281,7 @@ def window_new(configs: list[dict], debug: bool):
|
||||||
if filter.reduce(e.ipc_data):
|
if filter.reduce(e.ipc_data):
|
||||||
container_id = e.ipc_data['container']['id']
|
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}"] 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)
|
configs.pop(i)
|
||||||
if not configs:
|
if not configs:
|
||||||
ipc.main_quit()
|
ipc.main_quit()
|
||||||
|
@ -294,7 +295,7 @@ async def run(configs: list[dict], *, timeout: int, debug: bool):
|
||||||
for cfg in configs:
|
for cfg in configs:
|
||||||
cfg['filter'] = parse(cfg['filter'])
|
cfg['filter'] = parse(cfg['filter'])
|
||||||
p = cfg['program']
|
p = cfg['program']
|
||||||
if isinstance(p, list):
|
if isinstance(p, collections.abc.Iterable):
|
||||||
p = ' '.join(p)
|
p = ' '.join(p)
|
||||||
coroutines += [ipc.command(f'exec {p}')]
|
coroutines += [ipc.command(f'exec {p}')]
|
||||||
await asyncio.gather(*coroutines)
|
await asyncio.gather(*coroutines)
|
||||||
|
|
Loading…
Reference in a new issue