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

Move default config file to ~/.config/auto-selfcontrol #62

Merged
merged 1 commit into from
May 30, 2021

Conversation

sbibauw
Copy link
Contributor

@sbibauw sbibauw commented May 26, 2021

The config file will be looked for in

  • ~/.config/auto-selfcontrol/config.json
  • /usr/local/etc/auto-selfcontrol/config.json
  • $DIR/config.json (same directory as where Auto-SelfControl has been installed)
    If not found, created in ~/.config/auto-selfcontrol/config.json

This will make it easier to backup and sync it across installs. Answers #58

It also works on new ARM-based M1 Macs where brewed bins are in /opt/homebrew/, no longer in /usr/local/.

This will not move an existing config file.
Moving can be done manually:

mv /usr/local/etc/auto-selfcontrol/config.json ~/.config/auto-selfcontrol/

auto-selfcontrol will find this new location first.

The config file will be looked for in
- ~/.config/auto-selfcontrol/config.json
- /usr/local/etc/auto-selfcontrol/config.json
- $DIR/config.json (same directory as where Auto-SelfControl has been installed)
If not found, created in ~/.config/auto-selfcontrol/config.json

This will make it easier to backup and sync it across installs.
Answers andreasgrill#58

It also works on new ARM-based Macs where brewed bins are in `/opt/homebrew/`, no longer in `/usr/local/`.

This will not move an existing config file.
Moving can be done manually:

mv /usr/local/etc/auto-selfcontrol/config.json ~/.config/auto-selfcontrol/

auto-selfcontrol will find this new location first.
@andreasgrill
Copy link
Owner

Thanks for the PR! I agree that storing the configuration in the user home dir is better for backups and migrations.
I think we need to specify the settings dir when auto-selfcontrol is started via launchd as a launch daemon.
I've tried this locally and will fix this with an additional commit after merging your PR.

@andreasgrill andreasgrill merged commit aff03e8 into andreasgrill:master May 30, 2021
@sbibauw sbibauw deleted the config-location branch May 31, 2021 05:22
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.

2 participants