Overview
Variables
Path to the JSON config file (default: ~/.config/ProcessWatcher/config.json).
Methods
Loads config from configPath, merged with any values previously passed to
configure(), filling in defaults for missing keys. Never writes configPath --
it is purely hand-managed. Errors (via error()) if the resulting config is
invalid (e.g. interval >= sustainSeconds) without touching any previously-loaded
config -- so a broken on-disk file can never disrupt already-running monitoring
via reloadConfig(), only prevent a first-ever start().
Merges cfg into the Lua-side config overlay and recomputes the effective
config against the current on-disk config.json, restarting monitoring if
running. Never writes configPath -- it is purely hand-managed; cfg values
take effect in memory only and are reapplied on every subsequent loadConfig()/
reloadConfig() call. Errors (via error()) if the resulting config is invalid
(e.g. interval >= sustainSeconds) without applying any of it -- currently-running
monitoring, if any, is left untouched.
Re-reads configPath from disk (e.g. after hand-editing it) and restarts monitoring if running.
Opens the config file in the user's default editor for JSON files.
Snoozes alerts for name for config.snoozeHours and clears any current flag on it.
Terminates a process by name (all PIDs currently aggregated under that name in the last sample) or by PID (numeric string/number). Returns true if any PID was targeted.
Returns a human-readable summary of currently-flagged processes, processes still accumulating sustain ticks toward a flag, and the current top CPU/memory processes (used by the CLI).
Returns a one-line summary of the current thresholds/sustain/interval/allowlist/overrides config (used by the CLI).
Called automatically by hs.loadSpoon(). Logs the loaded version.
Begins periodic sampling and shows the menu bar icon.
Stops sampling and removes the menu bar icon.