Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-f --format parameter added #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion i3_workspace_names_daemon.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def build_rename(i3, app_icons, args):
func
The rename callback.
"""
form = args.format
delim = args.delimiter
length = args.max_title_length
uniq = args.uniq
Expand Down Expand Up @@ -80,7 +81,7 @@ def rename(i3, e):
names = [x for x in names if x not in seen and not seen.add(x)]
names = delim.join(names)
if int(workspace.num) >= 0:
newname = u"{}: {}".format(workspace.num, names)
newname = form.format(workspace.num, names)
else:
newname = names

Expand Down Expand Up @@ -170,6 +171,10 @@ def main():
parser.add_argument("-config-path",
help="Path to file that maps applications to icons in json format. Defaults to ~/.i3/app-icons.json or ~/.config/i3/app-icons.json or hard-coded list if they are not available.",
required=False)
parser.add_argument("-f", "--format",
help='Format of the workspace number + names/icons.\nThe first "{}" represents the workspace number space and the second represents the names/icons space.\nEx: - "{}: {}" (Default)\n - "{} - {}"\n - "{} ( {} )"',
required=False,
default="{}: {}")
parser.add_argument("-d", "--delimiter",
help="The delimiter used to separate multiple window names in the same workspace.",
required=False,
Expand Down