automation
Auto-Syncing Chezmoi to Git
A simple daemon that auto-adds new files to chezmoi and pushes to git. Nothing fancy, just scratching an itch.
chezmoidotfilessystemdautomationarch-linux
Auto-Syncing Chezmoi to Git
I use chezmoi for dotfiles. It works well but I wanted two things it doesn't do out of the box:
- Auto-add new files - when I create a new file in a tracked directory, add it automatically
- Notifications - tell me when stuff actually syncs
You can do most of this with chezmoi's built-in git commands and a cron job. This is just a small daemon that adds the auto-add behavior and desktop notifications on Wayland.
What It Does
- Polls every 60 seconds
- Runs
chezmoi re-addfor existing files - Auto-adds new files in tracked directories
- Commits and pushes if anything changed
- Desktop notification on successful sync
Install
git clone https://github.com/williavs/omarchy-dotfiles-sync
cd omarchy-dotfiles-sync
./setup
Service starts automatically.
Commands
systemctl --user status dotfiles-sync # check status
systemctl --user restart dotfiles-sync # restart
tail -f ~/.local/state/dotfiles-sync.log # watch logs
Configuration
Change polling interval in ~/.config/systemd/user/dotfiles-sync.service:
Environment="DEBOUNCE=120" # seconds between checks
Reload after changes:
systemctl --user daemon-reload
systemctl --user restart dotfiles-sync
Ignoring Files
Add patterns to ~/.local/share/chezmoi/.chezmoiignore:
.claude/history.jsonl
.claude/todos/
.claude/debug/
GitHub: omarchy-dotfiles-sync