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

Change or allow changing location of config file #58

Open
jaworek opened this issue Dec 5, 2020 · 2 comments
Open

Change or allow changing location of config file #58

jaworek opened this issue Dec 5, 2020 · 2 comments

Comments

@jaworek
Copy link

jaworek commented Dec 5, 2020

Having config file in HOME directory would be useful for backup and sharing.
Would it be possible to change it to follow XDG Base Directory Specification?
Is there a reason for config file to be in the current directory?

I'm more than happy to create PR for that, although it seems that it will be required to create a migration script for current users.

https://wiki.archlinux.org/index.php/XDG_Base_Directory

sbibauw added a commit to sbibauw/auto-selfcontrol that referenced this issue May 26, 2021
CONFIG_FILE will be looked for in
- ~/.config/auto-selfcontrol/
- /usr/local/etc/auto-selfcontrol/
- $DIR/ (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

This will not move an existing config file.
Moving can be done manually to ~/.config/auto-selfcontrol/config.json
(and removing the previous location)
and Auto-selfcontrol will find the new location.
sbibauw added a commit to sbibauw/auto-selfcontrol that referenced this issue 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 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.
@sbibauw
Copy link
Contributor

sbibauw commented May 26, 2021

I agree with @jaworek. Plus the current workflow does not work on new M1 Macs (where Homebrew installs at /opt/homebrew/.

I created PR #62 to solve this. It doesn't do the migration, but it will not break for previous config locations.

@Pandoks
Copy link

Pandoks commented Oct 15, 2023

I created Hammer Control which inputs the password into the prompt of the newest version of Self Control. It also lets you define a specific blacklist for every scheduled session which seems like something that you'd like.

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

No branches or pull requests

3 participants