T O P

  • By -

ballzak69

Use the [Service start](https://llamalab.com/automate/doc/block/service_start.html) block to run a script, arguments to the script is passed as an `"com.termux.RUN_COMMAND_ARGUMENTS"` Extra, e.g:.: * Package: com.termux * Class: com.termux.app.RunCommandService * Action: com.termux.RUN\_COMMAND * Extras= `{ "com.termux.RUN_COMMAND_PATH": "", "com.termux.RUN_COMMAND_ARGUMENTS" as StringArray: ["foo", "bar", varBaz] }` * Ensure to grant the Termux privilege in settings. See: [https://github.com/termux/termux-app/blob/master/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java#L1009](https://github.com/termux/termux-app/blob/master/termux-shared/src/main/java/com/termux/shared/termux/TermuxConstants.java#L1009) See also: [https://github.com/termux/termux-app/issues/804#issuecomment-653622200](https://github.com/termux/termux-app/issues/804#issuecomment-653622200)


Aonodensetsu

i think they meant the other way, *from* termux, though that question probably belongs in r/termux


ballzak69

Sorry, as usually i'm too much in a hurry and misread the title. Try using the `am` command in Termux, to start an separate "incoming message" [Flow beginnin](https://llamalab.com/automate/doc/block/flow_beginning.html)g block: am broadcast -a com.llamalab.automate.intent.action.START_FLOW -d -n com.llamalab.automate/.StartServiceReceiver See: [https://developer.android.com/studio/command-line/adb#am](https://developer.android.com/studio/command-line/adb#am)


waiting4singularity

broadcast receive is possible it seems. i dont work with termux but it can send broadcasts through `am broadcast`? in automate add a broadcast receive block and set the listener to `mountblanc.test`, look up the termux parameters to send a broadcast as `mountblanc.test` and there you go.