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

Add documentation from wiki.termux.com #3184

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/en/Addons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Termux has some extra features. You can add them by installing addons:

- [Termux:API](Termux:API): Access Android and Chrome hardware features.
- [Termux:Boot](Termux:Boot): Run script(s) when your device boots.
- [Termux:Float](Termux:Float): Run Termux in a floating window.
- [Termux:Styling](Termux:Styling): Have color schemes and powerline-ready fonts customize the appearance of the Termux terminal.
- [Termux:Tasker](Termux:Tasker): An easy way to call Termux executables from Tasker and compatible apps.
- [Termux:Widget](Termux:Widget): Start small scriptlets from the home screen.
6 changes: 6 additions & 0 deletions docs/en/Audio_Editors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Audio editing software is software which allows editing and generating
of audio data. Audio editing software can be implemented completely or
partly as library, as computer application, as Web application or as a
loadable kernel module.

## [ffmpeg](ffmpeg)
110 changes: 110 additions & 0 deletions docs/en/Backing_up_Termux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
This page shows an example of backing up your Termux installation.
Instructions listed there cover basic usage of archiving utility "tar"
as well as show which files should be archived. **It is highly
recommended to understand what the listed commands do before
copy-pasting them.** Misunderstanding the purpose of each step may
irrecoverably damage your data. If that happened to you - do not
complain.

# Backing up

In this example, a backup of both home and sysroot will be shown. The
resulting archive will be stored on your shared storage (`/sdcard`) and
compressed with `gzip`.

1\. Ensure that storage permission is granted:

`termux-setup-storage`

2\. Backing up files:

`tar -zcf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files ./home ./usr`

Backup should be finished without any error. There shouldn't be any
permission denials unless the user abused root permissions. If you got
some warnings about socket files, ignore them.

**Warning**: never store your backups in Termux private directories.
Their paths may look like:

`/data/data/com.termux                       - private Termux directory on internal storage`
`/sdcard/Android/data/com.termux             - private Termux directory on shared storage`
`/storage/XXXX-XXXX/Android/data/com.termux  - private Termux directory on external storage, XXXX-XXXX is the UUID of your micro-sd card.`
`${HOME}/storage/external-1                  - alias for Termux private directory on your micro-sd.`

Once you clear Termux data from settings, these directories are erased
too.

# Restoring

Here will be assumed that you have backed up both home and usr directory
into same archive. Please note that all files would be overwritten
during the process.

1\. Ensure that storage permission is granted:

`termux-setup-storage`

2\. Extract home and usr with overwriting everything. Pass
`--recursive-unlink` to remove any junk and orphaned files. Pass
`--preserve-permissions` to set file permissions as in archive, ignoring
the umask value. By combining these extra options you will get
installation state exactly as was in archive.

`tar -zxf /sdcard/termux-backup.tar.gz -C /data/data/com.termux/files --recursive-unlink --preserve-permissions`

Now close Termux with the "exit" button from notification and open it
again.

# Using supplied scripts

The latest version of package "termux-tools" contains basic scripts for
backup and restore of Termux installation. They are working in a way
similar to tar commands mentioned above.

**These scripts backup and restore scripts will not backup, restore or
in any other way touch your home directory.** Check out the
[notice](https://github.com/termux/termux-packages/blob/06499edb90a16fa471cff739ffee634f42a73913/packages/termux-tools/termux-restore#L6-L34)
if have questions why so. Termux developers are not responsible with
what you are doing with your files. If you managed to lost data, that
would be your own problem.

## Using termux-backup

Simple backup with auto compression:

`termux-backup /sdcard/backup.tar.xz`

Compression format is determined by file extension, which is typically
.tar.gz (gzip), .tar.xz (xz) or .tar (no compression).

It is possible to stream backup contents to standard output, for example
to encrypt it with GnuPG utility or send to remote storage. Set file
name as "-" to enable streaming to stdout:

`termux-backup - | gpg --symmetric --output /sdcard/backup.tar.gpg`

Content written to stdout is not compressed.

## Using termux-restore

**Warning**: restore procedure will destroy any previous data stored in
\$PREFIX. Script will perform a complete rollback to state state exactly
as in backup archive.

Restoring backup is also simple:

`termux-restore /sdcard/backup.tar.xz`

Once finished, restart Termux application.

The utility `termux-restore` is able to read backup data from standard
input. You can use this for reading content supplied by other tool.
Backup contents supplied to stdin must not be compressed. See below
example for restoring from encrypted, compressed backup:

`export GPG_TTY=$(tty)`
`gpg --decrypt /sdcard/backup.tar.gz.gpg | gunzip | termux-restore -`

Please note that if restore procedure will be terminated before finish,
your environment will be corrupted.
116 changes: 116 additions & 0 deletions docs/en/Building_packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Building packages

## Using Termux build environment

A recommended way of building is to use official build environment
available on Github: <https://github.com/termux/termux-packages>. See
[Termux Developer's
Wiki](https://github.com/termux/termux-packages/wiki) for tips about its
usage.

- <https://github.com/termux/termux-packages/wiki/Build-environment> -
setting up build environment.

<!-- -->

- <https://github.com/termux/termux-packages/wiki/Building-packages> -
how to build a package.

<!-- -->

- <https://github.com/termux/termux-packages/wiki/Creating-new-package> -
information about writing package scripts (build.sh).

### On-device usage

It is possible to use our build environment directly on device without
Docker image or VM setup. You need only to:

1\. Clone the git repository:

git clone https://github.com/termux/termux-packages

2\. Execute setup script:

`cd termux-packages`
`./scripts/setup-termux.sh`

Packages are built by executing `./build-package.sh -I package_name`.
Note that option "-I" tells build-package.sh to download and install
dependency packages automatically instead of building them which makes
build a lot faster.

By default, with Termux build environment you can build only existing
packages. If package is not exist in `./packages` directory, then you
will have to write its build.sh manually.

**If you managed to successfully build a new package, consider to make a
pull request.**

Some notes about on-device building:

- Some packages are considered as unsafe for building on device as they
remove stuff from `$PREFIX`.

<!-- -->

- During build process, the compiled stuff is installed directly to
`$PREFIX` and is not tracked by dpkg. This is expected behaviour. If
you don't want this stuff, install generated deb files and uninstall.

<!-- -->

- Some packages may throw errors when building on device. This is known
issue and tracked in
<https://github.com/termux/termux-packages/issues/4157>.

<!-- -->

- On-device package building for android-5 branch is not tested well.

## Manually building packages

There no universal guide about building/porting packages in Termux,
especially since Termux isn't a standard platform.

Though you can follow some recommendations mentioned here:

1\. Make sure that minimal set of build tools is installed:

`pkg install build-essential`

2\. After extracting package source code, check for files named like
"README" or "INSTALL". They usually contain information about how to
build a package.

3\. Autotools based projects (have ./configure script in project's root)
in most cases can be built with the following commands:

`./configure --prefix=$PREFIX`
`make && make install`

It is highly recommended to check the accepted configuration options by
executing `./configure --help`.

In case of configuration failure, read the output printed on screen and
check the file `config.log` (contains a lot of text, but all information
about error's source exist in it).

4\. CMake based projects (have CMakeLists in project's root) should be
possible to build with:

`mkdir build`
`cd build`
`cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" ..`
`make`
`make install`

Be careful when running `make install` as it will unconditionally write
files to `$PREFIX`. Never execute any of build commands as root.

**Note about "bug reports":** if you trying to build custom package and
it fails, do not submit bug reports regarding it.

**Note about "package requests":** if you decided to submit a package
request for package that you can't build, make sure this package will be
useful for others. Otherwise such requests will be just rejected.
38 changes: 38 additions & 0 deletions docs/en/Community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Any questions after reading the [FAQ](FAQ)? Consider joining
us with a cup of herbal tea, and similar. Termux is a distributed
community worldwide. Here are a few ways to get in touch:

## Official communities

- **Homepage** : <https://termux.dev/>
- **Github** : <https://github.com/termux/>
- **Gitter** : <https://gitter.im/termux/termux>
- **Discord** : <https://discord.gg/HXpF69X>
- **[IRC](IRC)** : Channel \#Termux on
[libera.chat](https://libera.chat/)
- **Email** : [[email protected]](https://groups.io/g/termux)
- **Reddit** : <https://www.reddit.com/r/termux>
- **Facebook** : <https://facebook.com/termux/>
- **Twitter** : <https://twitter.com/termuxdevs>
- **Telegram** : <https://telegram.me/termux24x7>
- **YouTube** :
<https://www.youtube.com/channel/UCGCVyLywi5KfW6n-54tiiJQ>

### Rules

## Other (non-official) communities

Here is a list of non-official communities. Termux developers are not
responsible about any information or misinformation, site links and
files distributed in these communities.

- **Facebook Group** : <https://facebook.com/groups/termux/>
- **Telegram Chinese community**: <https://telegram.me/Termux_CN/>
- **Telegram Ethiopian community**:
<https://telegram.me/Et_Termux_community/>
- **Telegram Spanish community**: <https://t.me/termux_es>
- **QQ Chinese community**: <https://jq.qq.com/?_wv=1027&k=ylRxQK7Z>

# See Also

- [Development](Development)
63 changes: 63 additions & 0 deletions docs/en/Community_Rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Official communities are curated by [@termux
developers](https://github.com/orgs/termux/people) or by trusted person.
Each community follows these rules with no exceptions unless specified
otherwise:

**1. Please use English.**

Our community is international and English here is a standardized
language which makes easier to follow conversations.

**2. Use of Termux for digital threatening is not tolerated.**

We discourage use of Termux application as base for digital threatening,
including but not limited to hacking, phishing or spying. Even though
Termux is known to be successfully used by penetration testing
professionals, we do not provide any kind of assistance related to
potentially destructive Termux use cases. Therefore we kindly asking our
community participants to abstain from asking for help with mentioned
topics or we will have to finish your membership.

Publications violating this rule will be deleted. Users violating this
rule may receive a permanent ban.

**3. Explicitly toxic behavior, trolling and flood are not tolerated.**

Deliberate offensiveness against specific persons or whole community, as
well as any behavior aimed at disrupting conversations, is strongly
discouraged.

Publications violating this rule will be deleted. Users violating this
rule may receive a temporary or permanent ban.

**4. Our topic is Termux, its use cases, user experience and content
share.**

Our communities are solely about Termux, its use cases, usage experience
and content produced by community members.

Little off-topic is okay, but abuse of or community for gathering
knowledge about custom ROMs, custom kernels, Android OS, networking,
programming, general computer science and basics is strongly
discouraged. If you are looking for help with topic that is not directly
connected with Termux project, please consider looking into more
suitable communities and Internet resources.

You should not post any kind of information that discourage use of
Termux application and its packages in the context of advertising own or
third-party "better" utility.

Off-topic publications will be removed. Publications with inappropriate
content (nsfw, gambling, lotteries, etc) will lead to permanent ban of
their author.

**5. Avoid direct messaging to Termux maintainers.**

Please use community social media to ask questions about Termux.

Do not ask Termux developers for every single question about Termux,
especially when it comes about utility usage or how to get started. We
have community pages on various social media sites where you can ask
your questions or share some Termux-related content.

[See the available Community Pages](Community).
Loading