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

load nfc2klipper cfg from home directory #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thijstriemstra
Copy link
Contributor

@thijstriemstra thijstriemstra commented Dec 18, 2024

I prefer not to modify the config file in the repository (making it harder to git pull and solve conflicts) so I suggest to place the config in the home directory instead.

@thijstriemstra thijstriemstra marked this pull request as ready for review December 18, 2024 16:29
@bofh69
Copy link
Owner

bofh69 commented Dec 19, 2024

I agree, its better to keep a separate file so pulling changes won't risk unnecessary conflicts.

Maybe it is better to use ~/.config/nfc2klipper/config.json5 or ~/.config/nfc2klipper.json5 though to keep $HOME uncluttered.
Some other klipper related programs put their configuration files in ~/klipper_config/, that's also an option.

@thijstriemstra
Copy link
Contributor Author

sounds good. creating that directory and placing the file sounds like something an install script should do, shall i add one?

@bofh69
Copy link
Owner

bofh69 commented Dec 22, 2024

Yes, please add one.

@scoggins
Copy link
Contributor

scoggins commented Jan 2, 2025

the other option is have a nfc2klipper-config.json5.default file in the repo, then add nfc2klipper-config.json5 to the .gitignore file. This way we can copy the default to nfc2klipper-config.json5 and make our own changes and git ignores them. But yes using ~/.config is also an option.

The advantage of the .default copy is people know what options can be in the config.

@bofh69
Copy link
Owner

bofh69 commented Jan 3, 2025

I implemented toml support (kind of like klipper/moonraker's config files) yesterday and then it reads the config file from ~/.config/nfc2klipper/nfc2clipper.cfg or ~/nfc2klipper.cfg.

See the switch-to-toml branch.

There is no automatic upgrade from the json5 file, but if it doesn't find a config file it copies the included config file.

@thijstriemstra
Copy link
Contributor Author

thijstriemstra commented Jan 20, 2025

see the switch-to-toml branch

nice! could you turn the branch into a pull request so it's easier to review?

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

Successfully merging this pull request may close these issues.

3 participants