termux-api icon indicating copy to clipboard operation
termux-api copied to clipboard

more features for termux-storage-get

Open knyipab opened this issue 2 years ago • 4 comments

This goal of this request is to enrich termux-storage-get to what "Open ..." and "Open Folder ..." usually do in PC, while keeping backward compatibility.

  • high backward compatibility (termux-storage-get output-name works as usual)
  • print URIs in JSON array (or line format with -l), resolves part of discussion in #199
  • when output-name is not present, only print out URIs
  • synchronous call (wait until finish, should resovle #367, part of #199
  • open folder
  • persistable permission grant (persist after reboot)
  • supprot to get multiple file (accompany with output-name patterns like %d, %8d, %08d)
  • specify MIME type

See show_usage() of pull request on termux-api-package for more detailed usage.

knyipab avatar Mar 13 '22 14:03 knyipab

The folder function highly resembles SAF one, but termux-storage-get focuses on the concept of "Open ...", or perhaps termux-storage-get should be better do this job.

Also, let's consider this use case: user can pick one or multiple file(s) calling termux-storage-get, get URI(s) from stdout, and then manipulate the file URI(s) with termux-saf-* functions.

Therefore, please consider to adopt the changes, perhaps partly. Or even integrating it SAF as something like termux-saf-open would also be great.

knyipab avatar Mar 13 '22 14:03 knyipab

I haven't tried it out but the code looks good to me.

tareksander avatar Mar 15 '22 17:03 tareksander

Wow this looks super useful. So many missing features have been implemented. Any chance we get this thing merged?

cunlem avatar Sep 11 '22 14:09 cunlem