New File Processor

nfp is a tool that watches directories for new files and calls user-defined commands on them. Like automatically calling an upload script on a file exported from a graphics editor to a specified directory.


nfp is configured by a TOML file like this:

path = "/home/user/.local/share/nfp/export1"
command = "python"
args = ["/path/to/"]
debounce = 500

You can have more than one [[processors]] sections.

The debounce attribute is for programs that have a habit of re-opening and overwriting files several times in quick succession. This specifies a timeout in milliseconds to wait after the file was last written and closed before calling a processing command on it.

The config file is looked up in nfp/config.toml under the common config directory on you platform (using directories crate to resolve that.)


In the simplest case it's just:


You probably want to run that on start-up and redirect stdout/stderr somewhere sensible.

nfp >> ~/.local/state/nfp/log 2>&1

You could also just run it via nohup and simply close the terminal window after that.