mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-07 16:54:21 +02:00
i3-companion: simplify workspace duplicate renames
It seems we can initialize a lock without having a loop.
This commit is contained in:
parent
ce60feac8d
commit
af3ba1dd57
1 changed files with 1 additions and 3 deletions
|
@ -347,12 +347,10 @@ async def new_workspace(i3, event):
|
|||
|
||||
|
||||
@on(I3Event.WORKSPACE_INIT)
|
||||
@static(lock=None)
|
||||
@static(lock=asyncio.Lock())
|
||||
async def workspace_rename_duplicate(i3, event):
|
||||
"""Rename a workspace when initialized empty with a duplicate number."""
|
||||
# This will not be needed once https://github.com/i3/i3/pull/4252 is released.
|
||||
if workspace_rename_duplicate.lock is None:
|
||||
workspace_rename_duplicate.lock = asyncio.Lock()
|
||||
async with workspace_rename_duplicate.lock:
|
||||
workspace = event.current
|
||||
workspaces = await i3.get_workspaces()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue