diff --git a/buildAndRun.md b/buildAndRun.md index 83c9fad..11bf5a3 100644 --- a/buildAndRun.md +++ b/buildAndRun.md @@ -73,7 +73,7 @@ gitflow scan -d ~ --exclude node_modules --exclude vendor gitflow scan -d ~/projects --max-depth 2 --workers 16 ``` -### `watch` — periodic scan +### `watch` — periodic scan --- ```bash gitflow watch -d ~/projects -i 30s # scan every 30 seconds diff --git a/internal/notify/notify_unix.go b/internal/notify/notify_unix.go index 12ed2e9..1322db7 100644 --- a/internal/notify/notify_unix.go +++ b/internal/notify/notify_unix.go @@ -8,12 +8,20 @@ import ( ) // send prefers notify-send (Linux) and falls back to osascript (macOS). +// Notifications persist until clicked, with a 30-second cap. // If neither is installed the notification is dropped silently. func send(title, body string) error { if _, err := exec.LookPath("notify-send"); err == nil { - return exec.Command("notify-send", "-a", "gitflow", "--", title, body).Run() + return exec.Command("notify-send", + "-a", "gitflow", + "-t", "30000", // 30 s timeout + "-u", "critical", // persist until clicked on most DEs + "--", title, body, + ).Run() } if _, err := exec.LookPath("osascript"); err == nil { + // display notification has no built-in timeout; the system + // Notification Center settings control dismissal behaviour. script := fmt.Sprintf("display notification %q with title %q", body, title) return exec.Command("osascript", "-e", script).Run() }