From 1baed006841d54a22f34b4be30fc6ec94e46abf3 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 29 Jun 2026 21:57:45 -0400 Subject: [PATCH] flag to start minimized --- docs/build instructions.md | 3 ++- docs/tutorial.md | 9 ++++++++- src/AutoSplit.py | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/build instructions.md b/docs/build instructions.md index 7c41d119..a81508e6 100644 --- a/docs/build instructions.md +++ b/docs/build instructions.md @@ -42,9 +42,10 @@ All scripts pass the `--active` flag to make sure the active environment is used ## Install and Build steps - Run `./scripts/install.ps1` to create/update a virtual environment and install all dependencies. -- Run the app directly with `./scripts/start.ps1 [--auto-controlled]`. +- Run the app directly with `./scripts/start.ps1 [--auto-controlled] [--minimized]`. - Or debug by pressing `F5` in VSCode. - The `--auto-controlled` flag is passed when AutoSplit is started by LiveSplit. + - The `--minimized` flag starts the app minimized to the taskbar. Also intended for use with the LiveSplit integration. - Run `./scripts/build.ps1` or press `CTRL+Shift+B` in VSCode to build an executable. - Optional: Recompile resources after modifications by running `./scripts/compile_resources.ps1`. - This should be done automatically by other scripts diff --git a/docs/tutorial.md b/docs/tutorial.md index 346a34b3..ca5198dc 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -271,6 +271,13 @@ The size of the selected rectangle can also impact the CPU load (bigger = more C - All of these actions can also be handled by their corresponding buttons. - Note that pressing your Pause Hotkey does not serve any function in AutoSplit itself and is strictly used for the Pause flag. -#### LiveSplit Integration +### LiveSplit Integration See the [usage instructions](https://github.com/Toufool/LiveSplit.AutoSplitIntegration#openingclosing-autosplit). + +## Command-line options + +AutoSplit accepts the following command-line flags: + +- `--auto-controlled` is reserved for timer integrations and is passed automatically when AutoSplit is started by LiveSplit. You should not need to set it manually. +- `--minimized` starts AutoSplit minimized to the taskbar, so it stays out of the way. Mainly intended for use with a timer integration. diff --git a/src/AutoSplit.py b/src/AutoSplit.py index 975f8065..fd6e0fc5 100755 --- a/src/AutoSplit.py +++ b/src/AutoSplit.py @@ -104,6 +104,7 @@ def do_nothing(*_): ... class AutoSplit(QMainWindow, design.Ui_MainWindow): # Parse command line args is_auto_controlled = "--auto-controlled" in sys.argv + start_minimized = "--minimized" in sys.argv # Signals start_auto_splitter_signal = QtCore.Signal() @@ -264,7 +265,10 @@ def _update_checker_widget_signal_slot(latest_version: str, check_on_open: bool) # Automatic timer start self.timer_start_image.timeout.connect(self.__compare_capture_for_auto_start) - self.show() + if self.start_minimized: + self.showMinimized() + else: + self.show() # https://pyinstaller.org/en/stable/advanced-topics.html#module-pyi_splash # doc implies calling `pyi_splash.is_alive()` should return false should be enough, but in