diff --git a/cli/onionshare_cli/__init__.py b/cli/onionshare_cli/__init__.py index 42ec9673..4711f624 100644 --- a/cli/onionshare_cli/__init__.py +++ b/cli/onionshare_cli/__init__.py @@ -143,6 +143,12 @@ def main(cwd=None): help="Filename of persistent session", ) # General args + parser.add_argument( + "--title", + metavar="TITLE", + default=None, + help="Set a title", + ) parser.add_argument( "--public", action="store_true", @@ -234,6 +240,7 @@ def main(cwd=None): connect_timeout = int(args.connect_timeout) config_filename = args.config persistent_filename = args.persistent + title = args.title public = bool(args.public) autostart_timer = int(args.autostart_timer) autostop_timer = int(args.autostop_timer) @@ -280,6 +287,7 @@ def main(cwd=None): if mode_settings.just_created: # This means the mode settings were just created, not loaded from disk + mode_settings.set("general", "title", title) mode_settings.set("general", "public", public) mode_settings.set("general", "autostart_timer", autostart_timer) mode_settings.set("general", "autostop_timer", autostop_timer) diff --git a/cli/onionshare_cli/mode_settings.py b/cli/onionshare_cli/mode_settings.py index c2e5e6cd..9ebf8e61 100644 --- a/cli/onionshare_cli/mode_settings.py +++ b/cli/onionshare_cli/mode_settings.py @@ -42,6 +42,7 @@ class ModeSettings: }, "persistent": {"mode": None, "enabled": False}, "general": { + "title": None, "public": False, "autostart_timer": False, "autostop_timer": False, diff --git a/cli/onionshare_cli/resources/templates/chat.html b/cli/onionshare_cli/resources/templates/chat.html index b4443c09..7156d58c 100644 --- a/cli/onionshare_cli/resources/templates/chat.html +++ b/cli/onionshare_cli/resources/templates/chat.html @@ -2,7 +2,7 @@ - OnionShare + {% if title %}{{ title }}{% else %}OnionShare Chat{% endif %} @@ -11,7 +11,7 @@
-

OnionShare

+

{% if title %}{{ title }}{% else %}OnionShare Chat{% endif %}