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

feat: generate default config #250

Open
Parag003 opened this issue Feb 29, 2024 · 1 comment
Open

feat: generate default config #250

Parag003 opened this issue Feb 29, 2024 · 1 comment
Assignees

Comments

@Parag003
Copy link

Currently SWHKD leads to a config error if the file at the default config path is missing (/etc/swhkd/swhkdrc).

So the pr #249 i made was using a mechanism to generate a default config from example config , but as discussed with @Shinyzenith we could find i better way to do this.

@Parag003 Parag003 changed the title feat: generate default config if not exists feat: generate default config Feb 29, 2024
@InnocentZero
Copy link
Contributor

One way to go about this would be to get the latest swhkdrc from the github repository itself, either through Rust APIs or by running an external git command.

See here for examples of the external git command.

Pros of running git externally : dead easy and simple.

Cons: Rust can't handle the errors by itself. Also kind of a hacky way to do it.

Pros of getting it through some Rust API: Better interop with existing code. Can be handled in code completely without making external calls. Better error handling.

Cons: Depending on the framework, it can bloat the codebase by a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants