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.
Signature | hs.pathwatcher.new(path, fn) -> watcher |
---|---|
Type | Constructor |
Description | Creates a new path watcher object |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/pathwatcher/libpathwatcher.m line 83 |
Signature | hs.pathwatcher:start() |
---|---|
Type | Method |
Description | Starts a path watcher |
Parameters |
|
Returns |
|
Source | extensions/pathwatcher/libpathwatcher.m line 153 |
Signature | hs.pathwatcher:stop() |
---|---|
Type | Method |
Description | Stops a path watcher |
Parameters |
|
Returns |
|
Source | extensions/pathwatcher/libpathwatcher.m line 175 |