Add Nextcloud sync-needed prompt indicator#164
Merged
Conversation
A systemd user timer runs nextcloud-sync-check every 30 minutes, which uses rclone check to detect whether ~/nextcloud is out of sync with the remote and maintains a ~/.cache/nextcloud-sync-needed sentinel. The zsh prompt shows ☁️ while the sentinel is present, and nextcloud-sync clears it after a successful bisync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Linux systemd timer has no macOS equivalent, so add a launchd LaunchAgent that runs bin/nextcloud-sync-check every 30 minutes (and once at login). The plist is templated like rclone.conf so mac/setup.sh can substitute absolute paths, sets a Homebrew PATH so rclone resolves under launchd, and is loaded via launchctl. The check script, sync script, and prompt indicator are already cross-platform. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a background check + prompt indicator so I can tell at a glance whether
nextcloud-syncneeds to be run.bin/nextcloud-sync-check— runsrclone check, parses theN differences foundline and touches/removes a~/.cache/nextcloud-sync-neededsentinel. If the remote is unreachable (no summary line), it leaves the sentinel untouched to avoid false flags.bin/nextcloud-sync— clears the sentinel after a successfulbisync.systemd/user/nextcloud-sync-check.{service,timer}— oneshot service + 30-min timer (Persistent=truecatches up after suspend), wired intosystemd/setup.sh.zsh/prompt.zsh—nextcloud_indicatorshows ☁️ when the sentinel exists, added toPROMPToutside the~/Projectsgit block so it shows everywhere.Activation
Notes
.~lock.*#files currently count as differences; can add an exclude to the check if that noise is unwanted.🤖 Generated with Claude Code