mirror of
https://github.com/swaywm/sway.git
synced 2026-04-21 06:46:22 -04:00
feat(autoname-workspace) Add option to remove trailing whitespace
This commit is contained in:
parent
a7ec761da4
commit
c17d6355b1
1 changed files with 7 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ def rename_workspaces(ipc):
|
|||
continue
|
||||
icon_tuple += (icon,)
|
||||
name_parts["icons"] = " ".join(icon_tuple)
|
||||
if name_parts["icons"]:
|
||||
if not ARGUMENTS.remove_whitespace and name_parts["icons"]:
|
||||
name_parts["icons"] += " "
|
||||
new_name = construct_workspace_name(name_parts)
|
||||
ipc.command('rename workspace "%s" to "%s"' % (workspace.name, new_name))
|
||||
|
|
@ -98,6 +98,12 @@ if __name__ == "__main__":
|
|||
default="/tmp/sway-autoname-workspaces.log",
|
||||
help="Path for the logfile.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-rw",
|
||||
"--remove-whitespace",
|
||||
action="store_true",
|
||||
help="Set it to remove the trailing whitespace after the icons in the workspace's name."
|
||||
)
|
||||
args = parser.parse_args()
|
||||
global ARGUMENTS
|
||||
ARGUMENTS = args
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue