I wanted to be able to call a simple script from the console or Neovim that would supply an executable and an arbitrary number of files.
Using inotify, each file is monitored for changes; calling the executable when one is detected. The executable is implicitly watched.
This is a very quick and dirty solution. It uses eval
and doesn't perform any sanity checking. Nor does it check to see if watches are already in place. Use at your own risk.
In my own setup, I have a '~/.local/scripts/' directory which is on my $PATH. I have the script here named 'monitor'
Usage: $> monitor ./something_neat.py ./some_config.yaml ./pyproject.toml /var/tmp/something.png