This commit is contained in:
abxh 2022-04-19 04:11:03 +00:00 committed by GitHub
commit 3940410882
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,16 +64,18 @@ def parse_workspace_name(name):
"(?P<num>[0-9]+):?(?P<shortname>\w+)? ?(?P<icons>.+)?", name
).groupdict()
def construct_workspace_name(parts):
new_name = str(parts["num"])
if parts["shortname"] or parts["icons"]:
new_name += ":"
icon_count=len(parts["icons"].split())
if icon_count != 0:
new_name += ":"
if parts["shortname"]:
new_name += parts["shortname"]
if parts["icons"]:
if parts["icons"] and icon_count != 0:
new_name += " " + parts["icons"]
return new_name