termux / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
2.35k stars 461 forks source link

Post texts to a homescreen widget #394

Open seffparker opened 3 years ago

seffparker commented 3 years ago

Feature description A termux-widget command that shows the texts right in the home screen widget, like we use termux-notification or termux-toast.

Expected usage termux-widget --id widget1 --title "Sample title" --text "Sample text"

This should show the passed text arguments. If this feature is available, the possibilities are extended like notifying script outputs, watching logs, piping other termux-api outputs to home screen.

I have currently implemented a prototype with Termux+Nginx+Meta Widget. Termux will wrap the texts inside an HTML tag. Meta Widget fetch the HTML from local Nginx service. But, this method is not that efficient.

seffparker commented 3 years ago

This a sample prototype I have implemented using third-party solutions. These texts are posted from Termux.

sample-prototype

tareksander commented 3 years ago

I just saw this issue when I scrolled through the open issues here, I'm developing a GUI-oriented Termux plugin and I plan to support widgets. I post updates about the plugin on r/termux if you're interested.

seffparker commented 3 years ago

I really like your idea of the GUI plugin. I'm not sure if there any native widget API like Notification or Toasts.

Anyway, looking forward for your implementation. @tareksander