From a6d0ac9780dcb1a004705ec4e41093cb38723a94 Mon Sep 17 00:00:00 2001 From: hxr404 <55095883+hxr404@users.noreply.github.com> Date: Mon, 6 Jun 2022 02:32:25 +0200 Subject: [PATCH] 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. --- contrib/autoname-workspaces.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/autoname-workspaces.py b/contrib/autoname-workspaces.py index a960e9b78..2732c69d1 100755 --- a/contrib/autoname-workspaces.py +++ b/contrib/autoname-workspaces.py @@ -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))