Artificial intelligent assistant

understand if a shell process is in background? I keep an instance of mutt idling on a terminal, if it is on index or pager I want it to be able to receive a macro from an external process (AutoKey or xdotool etc..), but the external program need to check mutt isn't running some sub process (emacs, shell...), how to check? It is Linux, so if some `/proc/$pid/*` could work would be fine.

You could do this to emit child processes of mutt:


pgrep -l -P $(pgrep -x mutt)


`pgrep` man page

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7a2b093c7d5e87d4cd930571b1679046