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.33k stars 458 forks source link

Enhancements in termux-dialog #462

Open tathastu871 opened 3 years ago

tathastu871 commented 3 years ago

Feature description

1). Spinner

--->Multiple dropdown menus with each individual titles eg. termux-dialog -t group1 -v "command1, command2" -t group2 -v "command3,command4"

Options like above and it should create two drop down entries title group1 and group2. when we click group1 it will list command1 and command2 as sub dropdown menu.

2). Radio widget: ---> Multiple and parent-subchild radio widgets. eg ○Radiobutton1
|-------○Subradiobutton1-1 |----- ○Subradiobutton1-2 ○Radiobutton2 |------ ○Subradiobutton2-1 |----- ○Subradiobutton2-2

It can be used along with termux-url-opener or file-editor or any script that execute multiple functions.

For eg. If i select Radiobutton1 it will execute all actions specified under Subradiobutton1-1 & Subradiobutton1-2; OR; If i select Subradiobutton1-2 it will execute only action specified under that button

3). Addition of new dialog widget: Buttons(OPTIONAL: Currently bottom sheet fulfills the need but a central popup with stylish buttons will be pleasant than bottom sheet) eg. Running such widget will create a box menu popup exactly in center with buttons having titles and clicking on button will execute specific action in background. [Note:It will be useful with termux-url-opener and termux-file-editor to predefine functions and while sharing we can execute different functions just by clicking button. eg: while sharing url button will popup: one button has title dowload that will transfer url to curl, wget, youtube-dl; second button has title bookmark that when clicked will add url to file.]

4.) New argument to predefine commans/functions to each and every termux-dialog widgets

Currently we have to write multiple if elif statements to execute predefined commands based on button selected from dialog boxes.

However addition of new feature to define command/functions while creating widgets.

eg. termux-dialog sheet -v "Command1 -c "wget $1", Command2 -c "youtube-dl $1""

Above will create a sheet with command1 and command2 options. When specific button is selected specified button is executed

Reference implementation

Have you checked if the feature is accessible through the Android API? Do you know of other open-source apps that has a similar feature as the one you want? (Provide links)

tathastu871 commented 2 years ago

Any progress on it. Essentialy needed @Grimler91

tathastu871 commented 2 years ago

Like multiple choice of commands to execute with termux dialog along with grouping them

Efreak commented 2 years ago

This sounds useful, however rather than coming up with a new way to do things, I'd recommend looking at zenity, yad, xdialog, etc for syntax. For widgets, it might actually be easier to just use a WebView...