Repository navigation
feat: settings for running in the background and starting with Windows - #40
Merged
Merged
Conversation
…nd keeps the computer awake settings.get and settings.update read and change start_with_windows and keep_awake in config.toml, written in place with toml_edit so the owner's own lines and comments stay. keep_awake applies at once. The scheduled task's triggers follow the owner's choices: while running, the minute trigger plus the logon trigger when Botloft starts with Windows; after `service stop` (the app closing with the bots), only the logon trigger when it starts with Windows. The minute trigger also fires after a new sign-in, so a daemon started by the task (`--scheduled`) compares the sign-in with <home>\signin and, when Botloft does not start with Windows, takes the triggers off and exits until the app opens it. Spec 6, 11.2, 14, 15.1 and 15.2 describe it.
…ows and checking for updates Settings gets "In the background" with three switches: keep working after closing Botloft (the app's choice; off, closing hides the window, stops the bots and closes), start with Windows and keep the computer awake (the daemon's). About gets "Check for updates". Reopening after the bots were stopped says "Starting your bots…", and the welcome line follows the choices. The routine switch becomes the shared Switch.
This was referenced Sep 29, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Settings gets a section called In the background, with three switches. Each one has a line that says what the current choice does:
botloft.whenClosed).keep_awake). It now changes without restarting anything.The About section also gets Check for updates. It asks the release feed right away and either says this is the latest version or shows See the update.
How
settings.getandsettings.updatecalls. The daemon saves only the key that changed inconfig.toml, usingtoml_edit, so the owner's own lines and comments stay. The new file replaces the old one in a single rename.service stop: only the sign-in trigger, and only when Botloft starts with Windows.--scheduled) compares the current sign-in with<home>\signin, which holds the session id and sign-in time fromWTSQuerySessionInformationW. If Botloft does not start with Windows, it takes the triggers off and exits, until the app runsinstall. If the daemon crashes within the same sign-in, it still comes back.daemon_stop. The app also listens toonCloseRequested, which needs thehideanddestroypermissions.Switchcomponent.Tests
cargo test(daemon, core, store),clippy -D warnings(includingbotloft-app),fmt, andpnpm check: all pass (151 app tests).Real test (Windows 11, a scratch data folder with its own task)
service install: the task has the sign-in trigger and the 1-minute trigger, the daemon runs, andsigninis written.service stop: only the sign-in trigger is left, the daemon stops, and it stayed stopped for 80 s.config.tomlkeeps its comment and port. A UTF-8 file with a BOM was also read correctly.signinfile, then the daemon was killed): the 1-minute trigger started it, the daemon logged that it is waiting to be opened, and it left the task with no triggers.service stopthen left only the sign-in trigger.Manual steps still open