termux/termux-widget

Please include simple script example in README.md

reikred opened this issue · 5 comments

First thing: The README.md ought to include a small "hello world" or similar sample script, and in particular it should include that the shebang should have the form

#!/data/data/com.termux/files/usr/bin/bash

or similar for other shells. There is too much guesswork that takes time. Just a very simple example will do.

Second thing: I installed a little script ~/.shortcuts/myscript, and it runs fine from the command line, but when I start the termux:widget, it does not appear as a clickable button. Instead I get some screen about whether I want to "disable launcher icon". It is not clear to me what I am supposed to do.

First thing: The README.md ought to include a small "hello world" or similar sample script, and in particular it should include that the shebang should have the form

Sure, we can add that

but when I start the termux:widget, it does not appear as a clickable button

Shortcurt needs to be added to the home screen as a widget, exactly how to do that vary between devices, but typically you long press home screen, press widgets, and then scroll down to the "termux" section:

widget_1

widget_2

Thank you, I picked the big widget and moved it to an empty screen. Might be good to make the above pictures and explanation part of README.md, too :-).

It would have been nice if I could drop the widget into my home screen tools folder. but so far no luck with that. If anyone knows how to do that , please post.

New problem: Widget seems to work, but my script runs again and again although I invoked it only once. I'd better write up another issue about that (done).

Widget are not meant to be moved into folders, you can move the shortcut instead.

Thanks, I also read somewhere that alternative launcher apps such as yandex launcher supports widgets in folder, but I have not tested yet.

It does apparently.

Smart folders: Give every folder its own screen with widgets and a background.

https://play.google.com/store/apps/details?id=com.yandex.launcher&hl=en&gl=US

It is "technically" possible, but not something Termux:Widget would need to do anything about or support since widget creation is handled by the launcher app, unless there are some UI issues that need fixing in folder mode that are being caused by Termux:Widget.