docs » hs.pathwatcher
Watch paths recursively for changes
This simple example watches your Hammerspoon directory for changes, and when it sees a change, reloads your configs:
local myWatcher = hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", hs.reload):start()
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
- Constructors - API calls which return an object, typically one that offers API methods
- new
- Methods - API calls which can only be made on an object returned by a constructor
- start
- stop
Signature | hs.pathwatcher.new(path, fn) -> watcher |
---|---|
Type | Constructor |
Description | Creates a new path watcher object |
Parameters |
|
Returns |
|
Notes |
|
Signature | hs.pathwatcher:start() |
---|---|
Type | Method |
Description | Starts a path watcher |
Parameters |
|
Returns |
|
Signature | hs.pathwatcher:stop() |
---|---|
Type | Method |
Description | Stops a path watcher |
Parameters |
|
Returns |
|