is there some mechanism to be notified asynchronously when input from a 'file' is available?
I have a program that cyclically does its work. So far so good. But there also is a serial line and whenever a message appears there the program shall react immediately, do something special and then return to its eternal loop. A bit like a hardware interrupt, but fired by the info 'some input is available
notify-send "some input is available"
right after the part where you say "the program shall react immediately, do something special " . It is however still unclear to me whether this is what you need. It would be helpful if you can [edit] and add the code that you use in your script and indicate where and how you want the notification. – Raffa Jan 09 '21 at 13:00