Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please include simple script example in README.md #86

Open
reikred opened this issue Sep 5, 2022 · 5 comments
Open

Please include simple script example in README.md #86

reikred opened this issue Sep 5, 2022 · 5 comments

Comments

@reikred
Copy link

reikred commented Sep 5, 2022

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.

@Grimler91
Copy link
Member

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

@reikred
Copy link
Author

reikred commented Sep 5, 2022

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).

@agnostic-apollo
Copy link
Member

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

@reikred
Copy link
Author

reikred commented Sep 5, 2022

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

@agnostic-apollo
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants