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

Add configuration variables #71

Closed
coastalwhite opened this issue Jun 25, 2022 · 2 comments · Fixed by #167
Closed

Add configuration variables #71

coastalwhite opened this issue Jun 25, 2022 · 2 comments · Fixed by #167
Labels
configuration Everything to do with customization and configuration

Comments

@coastalwhite
Copy link
Owner

Add variables which can be inserted onto other configuration options

This would look like:

variables = {
    focus-color = "#FF0000",
}

# ... snip

switcher_color = "${focus-color}"
@coastalwhite coastalwhite added the configuration Everything to do with customization and configuration label Jun 25, 2022
@danma3x
Copy link
Contributor

danma3x commented Jul 2, 2023

I've looked into this, and my current suggestion would be rather hacky. Read the toml into a String, have a separate struct implementing Deserialize parse the variables into a HashMap, substitute the variables in-memory using regex, deserialize the resulting config, merge with default configuration. If that sounds reasonable enough, I'll start working on a PR for it.

@coastalwhite
Copy link
Owner Author

I think this is a good way to initially implement it. I would be very open to seeing a PR with this.

@coastalwhite coastalwhite linked a pull request Sep 20, 2023 that will close this issue
coastalwhite added a commit that referenced this issue Sep 20, 2023
Variable interpolation in the configuration file #71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Everything to do with customization and configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants