Skip to content

[Feature] Custom Config File Path with Git-Reminder Hint #8

@Eliezergh

Description

@Eliezergh

[Feature] Custom Config File Path with Git-Reminder Hint

Description

Currently, Syndi always reads and writes its configuration to ~/.syndi/config.json. This makes it hard to keep the config in version control, back it up, or move it to a new machine.

This feature adds a single setting that lets users point Syndi at a config.json of their choice — for example, one that already lives inside a dotfiles Git repository. Syndi itself performs no Git operations; the user remains fully in charge of their repository. As a gentle nudge, Syndi will show a notification after saving the config if it detects the file is inside a Git repository, reminding the user to commit and push.

Current Behaviour

  • ~/.syndi/config.json is the only supported config location (hardcoded in syndi.py).
  • No feedback is given to the user about version-controlling their config.

Proposed Behaviour

  1. Custom config path — A new field in ~/.syndi/settings.json (a small, machine-local bootstrap file) lets users specify an alternative path for config.json, e.g. ~/dotfiles/syndi/config.json.
  2. Git-repo hint — After every successful config save, if Syndi detects that the config file sits inside a Git repository (i.e. a .git directory exists somewhere in its parent hierarchy), it shows a macOS notification: "Config saved — don't forget to commit and push your changes."
  3. Feature is fully opt-in — When no custom path is configured, behaviour is identical to today.

Affected Code

File What changes
src/core.py New helper is_inside_git_repo(path) that walks parent dirs looking for .git; save_config() returns a boolean indicating whether the path is Git-tracked
src/syndi.py Reads optional config_path from ~/.syndi/settings.json at startup; after save_config(), fires a rumps notification if the helper returns True
src/preferences.py New text field in the Preferences dialog for the custom config file path

Acceptance Criteria

  • User can set a custom path for config.json via the Preferences dialog
  • Syndi reads from and writes to that custom path instead of the default
  • After saving, Syndi shows a notification reminding the user to push if the file is inside a Git repo
  • If no custom path is set, all behaviour is identical to today
  • Git detection never causes an error — if anything goes wrong it is silently ignored

Migration Path

  • First launch after the update: ~/.syndi/settings.json does not exist, so Syndi falls back to ~/.syndi/config.json as usual.
  • User opens Preferences, enters a path inside their dotfiles repo, and saves.
  • Syndi copies the existing ~/.syndi/config.json to the new location on first use.
  • All subsequent reads/writes go to the new path.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions