i3-companion: stable order for icons

This commit is contained in:
Vincent Bernat 2021-10-10 14:48:26 +02:00
parent 3c036a1f74
commit bba5ef6bb1

View file

@ -332,7 +332,7 @@ async def workspace_rename(i3, event):
icons.add(icon or application_icons_nomatch)
if any([i not in application_icons_alone for i in icons]):
icons -= application_icons_alone
new_name = f"{workspace.num}:{'|'.join(icons)}".rstrip(":")
new_name = f"{workspace.num}:{'|'.join(sorted(list(icons)))}".rstrip(":")
if workspace.name != new_name:
logger.debug("rename workspace %s", workspace.num)
command = f'rename workspace "{workspace.name}" to "{new_name}"'