StreamController icon indicating copy to clipboard operation
StreamController copied to clipboard

Action triggered by file/directory change (inotify)

Open jfbauer432 opened this issue 1 year ago • 2 comments

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.

jfbauer432 avatar Aug 17 '24 19:08 jfbauer432

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?

Core447 avatar Aug 24 '24 11:08 Core447

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?

jfbauer432 avatar Aug 25 '24 11:08 jfbauer432

The proposed solution sounds like it would go inthe OSPlugin. can we file that issue here please: https://github.com/StreamController/osplugin

ImDevinC avatar Jun 26 '25 18:06 ImDevinC