fix(autoname-workspace) Fix colon not getting removed after closing window

Fix a Bug resulting from faulty logic in the rename_workspaces where a whitespace
would have been added to the "icons" part of the workspace, no matters if
there are any icons present or not. This lead to the issue that not only a
trailing whitespace would've been erroneously added to the workspace's name,
but also that the colon separating the workspace number from the nonexistant
"icon" (only consisting of the whitespace) wouldn't disappear after closing
or moving all windows out of the workspace.
This commit is contained in:
hxr404 2022-06-06 02:32:25 +02:00
parent ad20fe5e28
commit a6d0ac9780
No known key found for this signature in database
GPG key ID: 265128F293C877D7

View file

@ -44,7 +44,9 @@ def rename_workspaces(ipc):
if not ARGUMENTS.duplicates and icon in icon_tuple:
continue
icon_tuple += (icon,)
name_parts["icons"] = " ".join(icon_tuple) + " "
name_parts["icons"] = " ".join(icon_tuple)
if name_parts["icons"]:
name_parts["icons"] += " "
new_name = construct_workspace_name(name_parts)
ipc.command('rename workspace "%s" to "%s"' % (workspace.name, new_name))