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 if not exists #249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Parag003
Copy link

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

This PR adds a mechanism to generate a default config (populated with an example from man 5 swhkd), the generated config is commented out by default.

@Parag003
Copy link
Author

Resolves #201

@Shinyzenith
Copy link
Member

Hi, while this is a good pr I am not a fan of the inline file writing we are doing as everytime we introduce new features, the examples need to be put into this file.

It's ideally the distributions responsibility during packaging to provide a sample config -- just how programs like sway and alacritty have theirs defaulted to by the distribution.

@zubairmh What do you think?

@zubairmh
Copy link

Hi, while this is a good pr I am not a fan of the inline file writing we are doing as everytime we introduce new features, the examples need to be put into this file.

It's ideally the distributions responsibility during packaging to provide a sample config -- just how programs like sway and alacritty have theirs defaulted to by the distribution.

@zubairmh What do you think?

We could have a default config in codebase that copies itself to the config path upon the first extension startup, something like in the sway codebase here. This PR could easily be modified to do something like that. @Shinyzenith

@Shinyzenith
Copy link
Member

I think having a example config would be nice but the copying function is responsbility of the distribution as they like to patch configs before pushing to users. Having the file in the repo means we need to bake it into the binary to finally write to disk -- increasing binary size.

@Parag003
Copy link
Author

@Shinyzenith any solutions for this?

@Shinyzenith
Copy link
Member

I think this pr would be better to just introduce a default config -- also lets discuss patches in the github issue before forming the pr -- I don't want any contributor to feel like their efforts are going to waste. This way we get to discuss about the project goals and if the pr is a good idea 😊

@Parag003
Copy link
Author

Hmm sure @Shinyzenith ill add the new issue

id3v1669 added a commit to id3v1669/swhkd that referenced this pull request Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants