Action triggered by file/directory change (inotify)
While working on a script that I have StreamController run, I thought it would have been nice if there was a way to run the script when some external event occurred (in my case when a file was added or removed from a directory). I used the run every x seconds feature in the OS Run Command action. That works, but does cause the commands to get run a lot when most of the time nothing will have changed.
So I propose that StreamController use inotify (or something similar) and a new config section be added to OS Run Command to specify what kind of event on what file/directory to watch for. When the inotify event is triggered, the specified command is run.
There may be other actions besides OS Run Command, where this would be useful.
While I absolutely see use cases for this, I don't think this is a feature for StreamController (or the OS plugin), but should instead be implemented with own scripts. What do you think?
I am not seeing how that would work. For example, if you have StreamController display the number of files in a directory. The script can't wait until the value changes, as it doesn't know what StreamController last displayed. Or is there a way to have it pass that kind of thing (the displayed text on a button) to a command?
The proposed solution sounds like it would go inthe OSPlugin. can we file that issue here please: https://github.com/StreamController/osplugin