Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/puutaro/CommandClick
Browse files Browse the repository at this point in the history
  • Loading branch information
puutaro committed Feb 13, 2023
2 parents 0720b2e + 59ef1ad commit a9f761a
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,42 @@ Pre Setting
Command Click is use [`RUN_COMMAND` Intent](https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent) in termux
and, require termux storage setting.
For Instance, bellow process.

1. Add com.termux.permission.RUN_COMMAND permission
`Android Settings` -> `Apps` -> `CommandClick` -> `Permissions` -> `Additional permissions` -> `Run commands in Termux environment`
3. Enable `allow-external-apps` [detail](https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent#allow-external-apps-property-mandatory)
4. Add Storage permission. [detail](https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent#storage-permission-optional)
5. Execute `termux-setup-storage` on termux
2. Paste bellow command to termux, press `Enter` ,and continue press `Enter` when comfirm

```
pkg update -y && pkg upgrade -y \
&& yes | termux-setup-storage \
&& sed -r 's/^\#\s(allow-external-apps.*)/\1/' -i "$HOME/.termux/termux.properties"
```

- reference
- Enable `allow-external-apps` [detail](https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent#allow-external-apps-property-mandatory))
- Add Storage permission. [detail](https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent#storage-permission-optional)
- Execute `termux-setup-storage` on termux

4. Set `Draw Over Apps permission` in `android 11+` (Optinal)

> You can grant Termux the Draw Over Apps permission from its App Info activity:
> `Android Settings` -> `Apps` -> `Termux` -> `Advanced` -> `Draw over other apps`.
[detail](https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent/06f1de1b262d7612497e76463d8cc34ba7f49832#draw-over-apps-permission-optional)

- When command not working, try execute bellow command, so `RUN_COMMAND SERVIDE` probably start up.

```
am startservice --user 0 -n com.termux/com.termux.app.RunCommandService \
-a com.termux.RUN_COMMAND \
--es com.termux.RUN_COMMAND_PATH '/data/data/com.termux/files/usr/bin/top' \
--esa com.termux.RUN_COMMAND_ARGUMENTS '-n,1' \
--es com.termux.RUN_COMMAND_WORKDIR '/data/data/com.termux/files/home' \
--ez com.termux.RUN_COMMAND_BACKGROUND 'false' \
--es com.termux.RUN_COMMAND_SESSION_ACTION '0'
```

- When above method cannot settle down, `CommandClick` or `Termux` restart, and system reboot.

Usage
-----
Expand Down Expand Up @@ -109,8 +138,9 @@ At the same time, if you installed code editor, edit new file.
| `terminalFontZoom` | `number` | adjust terminal font size (percentage) |
| `terminalFontColor` | `string` | adjust terminal font color |
| `terminalColor` | `string` | adjust terminal background color |
| `afterCommand` | command | before run shellscript, run command |
| `shellFileName` | string | shellscript file name |
| `beforeCommand` | `shell command string` | before run shellscript, run command |
| `afterCommand` | `shell command string` | after run shellscript, run command |
| `shellFileName` | `string` | shellscript file name |


- setVariableType option
Expand Down Expand Up @@ -236,9 +266,12 @@ Also, Click url on web terminal view, this mode is automatic set
`Command Click` have auto exec script. This is used when `index mode` startup or end.

#### Startup script
This script is automaticaly executed when `index mode` startup.
1. This script is automaticaly executed when `index mode` startup.
But, in default, `onAutoExec` in setting variable is `OFF` so, if you enable this, you must be `ON` (reference to [add](#add)).

2. Override `config setting variable`, if you are change default value with your set value.


#### End script

This script is automaticaly executed when `index mode` end.
Expand All @@ -251,7 +284,7 @@ Also whether click or long click torigger, due to `historySwitch` setting (refe

### Edit execute once

One time edit and exedute
One time edit and execute

![image](https://user-images.githubusercontent.com/55217593/216524059-97c35357-c0de-48c1-953f-b1e1478cf296.png)

Expand Down

0 comments on commit a9f761a

Please sign in to comment.