Repository navigation
Conversation
This was referenced Oct 30, 2026
aRustyDev
marked this pull request as ready for review
October 30, 2026 02:40
Collaborator
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.
TL;DR
Let users save playback settings and key bindings in
config.toml, with environment variables and explicit CLI flags taking precedence. Existing defaults remain the starting point.Note
#blocking #139
This PR is independent and ready for review. #139 waits for it to merge.
Changes
config.tomlfrom Lowfi's platform data directory; never create or overwrite it.LOWFI_*environment → explicit CLI flags. For example,LOWFI_UI__FPS=20overrides the file, and--fps 30overrides both.Ctrl+Creserved.LOWFI_DISABLE_UIandLOWFI_FIXED_MPRIS_NAMEswitches outside structured settings.docs/CONFIGURATION.mdas the options reference, with file locations, defaults, accepted values, env/CLI mappings, binding rules, and troubleshooting. Keep a short README example and cross-link the legacy environment-variable documentation.Why this approach
Flags work for a single invocation, but persistent settings currently need a shell alias or wrapper. A configuration file also gives key bindings a place to live.
Figment handles merging and source metadata instead of adding a custom file/env/CLI merge layer. Clap still parses CLI arguments; only explicitly supplied flags enter the merge, so parser defaults cannot silently overwrite a user's file. Strict validation catches misspellings rather than ignoring them. A binding list replaces one action's defaults, which also lets users disable that action's configurable keys with an empty list.
Preserve the existing width cap: values above 32 are accepted and render as 32. The reference and CLI help now describe that behavior. Rejecting those values would change established CLI behavior without being necessary for the configuration migration.
Validation
cargo test --locked: 46 passed, covering precedence, defaults, validation errors, bindings, and legacy environment switches. Config-loading tests isolate process environment changes with Figment Jail.cargo fmt --checkreports the inherited formatting differences insrc/ui/media_controls.rs, which this PR does not change.Checked the documented fields and scalar defaults against
Settings, parsed the TOML examples, verified relative file links, and ranlowfi --helpto confirm the width description. Private-item documentation builds with inherited shared-code link warnings, repaired in #139.