[android] termux support

Use case or problem

the ability to execute commands in the termux environment may be useful for plugin developers. some examples of the top of my head:

  • obsidian-git could directly run the git command as opposed to using the very limited isomorphic-git, which notably lacks ssh support
  • the reminders plugin could invoke termux-notification, which is helpful in the case you leave the app but still want to be reminded on time.

Proposed solution

a toggle-able setting that allows these commands to be run and requests the necessary permissions (that’s off by default).

as for the implementation:

termux exposes an intent api, which can be called upon by apps that request com.termux.permission.RUN_COMMAND.

further reading:

com.termux.RUN_COMMAND intent
capacitor js custom code docs

Current workaround (optional)

N/A

Related feature requests (optional)

N/A

2 Likes

That might actually allow me to convert Obsidian-OCR from a desktop-only plugin to a cross-platform one. After all, both dependencies required, tesseract and imagemagick, are available in the Termux repo

1 Like

and that could be considered as a “mainstream” use case, thus strengthening our case here :smiley:

i’ve decided to take it upon myself to create a capacitor plugin for this exact purpose (capacitor is what obsidian uses under the hood to run on ios/android)
if any obsidian developers would like to take a stab at testing it, please do!

< link >

Awesome :grinning: !
Could you give me a little hint on how to use this? Do I just add it as a dependency to my plugin and run npx cap sync? And how do I go from there?

unfortunately, it’s not that simple. this needs to be added to the core of obsidian itself by one of the people who actually have access to the source code and the mobile build configurations. :frowning: i only did this as a proof of concept, and to eliminate a good chunk of the legwork for the developers, which should (in theory) help our case.

Oh, I see.
Sorry for my misunderstanding :cry: