Compare commits
No commits in common. "ef8bf677ae0a0d8cfc22552d021d7fb2e6ce2f3b" and "fd777c2683048a337ac4acb4a90f8e8585f74de6" have entirely different histories.
ef8bf677ae
...
fd777c2683
1 changed files with 2 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
import collections.abc
|
||||||
import typing
|
import typing
|
||||||
import asyncio
|
import asyncio
|
||||||
import signal
|
import signal
|
||||||
|
@ -379,7 +380,6 @@ class Config(pydantic.BaseModel):
|
||||||
signal: typing.Optional[Signal] = None
|
signal: typing.Optional[Signal] = None
|
||||||
timeout: int = 3000
|
timeout: int = 3000
|
||||||
programs: typing.List[ProgramConfig]
|
programs: typing.List[ProgramConfig]
|
||||||
final_workspace: typing.Optional[str] = None
|
|
||||||
|
|
||||||
class RuntimeData(pydantic.BaseModel):
|
class RuntimeData(pydantic.BaseModel):
|
||||||
programs: typing.List[ProgramConfig] = []
|
programs: typing.List[ProgramConfig] = []
|
||||||
|
@ -398,6 +398,7 @@ def window_new(runtime_data: RuntimeData, *, debug):
|
||||||
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'move container to workspace {cfg.workspace}')
|
await ipc.command(f'move container to workspace {cfg.workspace}')
|
||||||
|
await asyncio.sleep(1)
|
||||||
runtime_data.programs.pop(i)
|
runtime_data.programs.pop(i)
|
||||||
if not runtime_data.programs:
|
if not runtime_data.programs:
|
||||||
ipc.main_quit()
|
ipc.main_quit()
|
||||||
|
@ -455,9 +456,6 @@ async def run(config: Config, *, debug: bool):
|
||||||
await asyncio.wait_for(runtime_data.ipc.main(), timeout=new_timeout/1000)
|
await asyncio.wait_for(runtime_data.ipc.main(), timeout=new_timeout/1000)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
return 1
|
return 1
|
||||||
finally:
|
|
||||||
if config.final_workspace is not None:
|
|
||||||
await runtime_data.ipc.command(f'workspace {config.final_workspace}')
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@click.group()
|
@click.group()
|
||||||
|
|
Loading…
Reference in a new issue