1
0
mirror of https://github.com/termux/termux-app synced 2024-06-15 05:46:37 +00:00
This commit is contained in:
glow 2024-05-07 17:49:27 +02:00 committed by GitHub
commit 89c648f1d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
148 changed files with 6096 additions and 5 deletions

8
docs/en/Addons.md Normal file
View File

@ -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
docs/en/Audio_Editors.md Normal file
View File

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

View File

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

View File

@ -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
docs/en/Community.md Normal file
View File

@ -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** : [termux+subscribe@groups.io](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)

View File

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

View File

@ -0,0 +1,66 @@
# OCaml + Termux
OCaml native on android!
This is a copy of the original article, available at
<http://ygrek.org.ua/p/ocaml-termux.html>
## Install
*Use binary OPAM package for aarch64 to build OCaml*
1\. Install OPAM
echo "deb [arch=all,aarch64] http://ygrek.org.ua/files/debian/termux ./" >> data/data/com.termux/files/usr/etc/apt/sources.list
apt-get update # repository is not signed for now :]
pkg install opam
2\. Install OCaml
opam init --comp=4.03.0+termux termux https://github.com/camlunity/opam-repository.git#termux
## Build
*Build OCaml to build OPAM to build OCaml*
1\. Prepare proper build environment.
`pkg install build-essential diffutils m4 patch`
2\. NB termux lacks `/bin/sh` (and all other standard unix file paths
for that matter), so the main problem during builds is hardcoded shell
path in <https://github.com/termux/termux-packages/issues/98>.
To overcome it - use `sh ./script` instead of just `./script`.
3\. Build OCaml
mkdir ~/tmp
export TMPDIR=$HOME/tmp # add to ~/.profile
git clone https://github.com/ygrek/ocaml.git -b termux-4.03.0
cd ocaml
sh ./configure -prefix $PREFIX
make world.opt install
4\. Build OPAM
curl -LO https://github.com/ocaml/opam/releases/download/1.2.2/opam-full-
1.2.2.tar.gz
tar -xzf opam-full-1.2.2.tar.gz
cd opam-full-1.2.2/
sed -i 's|/bin/sh|sh|' src/core/opamSystem.ml OCamlMakefile
CONFIG_SHELL=sh sh ./configure -prefix "$PREFIX"
OCAMLPARAM="safe-string=0,_" make lib-ext all install
5\. Add OPAM remote with Termux patches
opam remote add termux https://github.com/camlunity/opam-repository.git#termux
6\. Install OCaml via OPAM and remove system OCaml (built in step 3) to
avoid confusion with OPAM switches
opam sw 4.03.0+termux # 4.02.3+termux 4.04.0+termux
rm /data/data/com.termux/files/usr/man/man1/ocaml*
rm /data/data/com.termux/files/usr/bin/ocaml*
rm -rf /data/data/com.termux/files/usr/lib/ocaml
opam sw remove system

1
docs/en/Contact.md Normal file
View File

@ -0,0 +1 @@
1. REDIRECT [Community](Community)

162
docs/en/Development.md Normal file
View File

@ -0,0 +1,162 @@
The information on this page, while public, will primarily be of
interest to Termux developers.
## Development Mailing List
We have a [mailing list](https://groups.io/g/termux-dev), but it is not
really in use. If more Termux users would sign up please, it could
really be in use:
- <https://groups.io/g/termux-dev/join>
<!-- -->
- Help: termux-dev+help@groups.io
## Weekly Development Sessions
We currently do not perform the Weekly Development Sessions.
- [Protocols and upcoming
sessions](Dev:_Development_Sessions)
## Channels
Here is a list of channels of the Termux project, what they are for, and
who has special rights and responsibilities for them.
### GitHub Organization
- Link: <https://github.com/termux>
- Purpose: Termux Repositories
- Collaborators: See
[termux/people](https://github.com/orgs/termux/people)
### Community Forum
- Link: <https://termux.com/community>
- Purpose: General user community for Termux.
- Moderators: [fornwall](https://www.reddit.com/user/fornwall),
[glow(Neo_Oli)](https://www.reddit.com/user/Neo_Oli)
### User Mailing List
- Help: termux+help@groups.io
- Join: <https://groups.io/g/termux/join>
- Link: <https://groups.io/g/termux>
- Moderators: fornwall, glow, Grimler91
- Purpose: Mailing list for user discussions.
### Developer Mailing List
- Help: termux-dev+help@groups.io
- Join: <https://groups.io/g/termux-dev/join>
- Link: <https://groups.io/g/termux-dev>
- Moderators: fornwall, glow, Grimler91
- Purpose: Mailing list to discuss Termux development.
### Wiki
- Link: <https://wiki.termux.com>
- Purpose: Help pages
- Administrators: [glow](User:Glow),
[Auxilus](User:Auxilus),
[Fornwall](User:Fornwall)
- Hosting and Maintenance: [glow](User:Glow)
### Gitter User Channel
- Link: <https://gitter.im/termux/termux>
- Purpose: User Discussion
- Moderators: fornwall, glow(Neo-Oli), Grimler91
### Gitter Development Channel
- Link: <https://gitter.im/termux/dev>
- Purpose: Discussion about Termux development
- Moderators: fornwall, glow(Neo-Oli), Grimler91
### IRC User Channel
- Link: \#termux @ libera.chat
- Purpose: User Discussion. Mirrored to Gitter User Channel
- Moderators: fornwall, glow(frumpylava), Grimler91
### IRC Development Channel
- Purpose: Discussion about Termux development. Mirrored to Gitter
Development Channel
- Moderators: fornwall, glow(Neo-Oli), Grimler91
### Twitter
- Link: <https://twitter.com/termux>
- Purpose: Twitter
- Administrators: fornwall
### Facebook
- Link: <https://facebook.com/termux>
- Purpose: Facebook
- Administrators: fornwall
- Moderators: Auxilus
### F-Droid
- Links:
<https://f-droid.org/packages/com.termux/>
<https://search.f-droid.org/?q=Termux>
- Purpose: Download Termux and Termux Addons
### Google Play
DEPRECIATED AND UNSUPPORTED
- Link: <https://play.google.com/store/apps/details?id=com.termux>
- Purpose: Download Termux
- Administrator:
[fornwall](https://play.google.com/store/apps/developer?id=Fredrik+Fornwall)
### [Repositories](https://github.com/orgs/termux/repositories)
#### termux-app
- Link: <https://github.com/termux/termux-app>
- Purpose: Main app repository
#### termux-packages
- Link: <https://github.com/termux/termux-packages>
- Purpose: Main package repository
- Upload (android-5): *discontinued after 01.01.2020*
- Upload (android-7): Termux maintainers
#### termux-root-packages
- Link: <https://github.com/termux/termux-root-packages>
- Purpose: Package repository for packages requiring root
- Upload: [Grimler91](https://github.com/Grimler91)
#### game-packages
- Link: <https://github.com/termux/game-packages>
- Purpose: Package repository for games (or games-related) packages
- Upload: [Grimler91](https://github.com/Grimler91)
#### science-packages
- Link: <https://github.com/termux/science-packages>
- Purpose: Package repository for science-related packages
- Upload: [Grimler91](https://github.com/Grimler91)
#### x11-packages
- Link: <https://github.com/termux/x11-packages>
- Purpose: Package repository for x11 related packages
- Upload (android-7 only): Termux maintainers
# See Also
- [Community](Community)

View File

@ -0,0 +1,297 @@
Termux is often used for software development, information science
education and experimentation. Here are some articles and links with
information on how to make it possible with one of the following
programming environments.
## APKs
APKs (Android Package Kits) can be built in Termux on device with
<https://BuildAPKs.github.io/buildAPKs/>
## C/C++
Package: clang
Description: C language frontend for LLVM
Homepage: <http://clang.llvm.org/>
Related Issues:
<https://github.com/termux/termux-packages/issues?q=clang>
## Common Lisp
Package: ecl
Description: ECL (Embeddable Common Lisp) interpreter
Homepage: <https://common-lisp.net/project/ecl/>
## D
Package: ldc
Description: D programming language compiler, built with LLVM
Homepage: <https://dlang.org/>
Instructions: <https://wiki.dlang.org/Build_D_for_Android>
## Dart
Package: dart
Homepage: <https://www.dartlang.org/>
## Elixir
Package: elixir
Description: Programming language compatible with the Erlang platform
Homepage: <https://elixir-lang.org/>
## Erlang
Package: erlang
Description: Erlang programming language and runtime environment
Homepage: <https://www.erlang.org/>
## Forth
Package: pforth
Description: Portable Forth in C
Homepage: <http://www.softsynth.com/pforth/>
## Go
Package: golang
Description: Go programming language compiler
Homepage: <https://golang.org/>
Instructions: <https://gobyexample.com/hello-world>
## Groovy
Package: groovy
Description: A multi-faceted language for the Java platform
Homepage: <https://groovy-lang.org/>
## Haskell
Package: ghc
Description: Glasgow Haskell Compiler.
<u>ghc is currently disabled due to build issues</u>. Looking for
patches that will fix package.
Homepage: <https://www.haskell.org/ghc/>
Related Issues:
<https://github.com/termux/termux-packages/issues?q=haskell>
## Java
### ECJ
Package: ecj
Description: Eclipse Compiler for Java
Homepage: <http://www.eclipse.org/jdt/core/>
Related Issues: <https://github.com/termux/termux-packages/issues?q=ecj>
### OpenJDK
Package: openjdk-17
Description: Java development kit and runtime
Related Issues:
<https://github.com/termux/termux-packages/issues?q=openjdk>,
<https://github.com/termux/termux-packages/issues?q=java>
## JavaScript
See packages: quickjs, duktape, nodejs, nodejs-lts
### NodeJS
Homepage: <https://nodejs.org/>
## Kotlin
Package: kotlin
Homepage: <https://kotlinlang.org/>
## Lua
Package: lua52
Package: lua53
Package: lua54
Description: Lightweight embeddable scripting language
Homepage: <https://www.lua.org/>
## Nim
Package: nim
Description: Nim programming language compiler
Homepage: <https://nim-lang.org/>
## OCaml
- [Compiling and setting up
OCaml](Compiling_and_setting_up_OCaml) (a copy of the
article <http://ygrek.org.ua/p/ocaml-termux.html>)
<https://ocaml.org/learn/description.html>
Related Issues:
<https://github.com/termux/termux-packages/issues?q=ocaml>
## Octave
Octave is available from a community repository. Setup up
[its-pointless'](Package_Management#its-pointless_(live_the_dream))
repository.
<https://github.com/termux/termux-packages/issues?q=octave>
## Perl
Package: perl
Homepage: <https://www.perl.org/>
## PHP
Package: php
Description: Server-side scripting language
Homepage: <https://php.net>
Related Issues: <https://github.com/termux/termux-packages/issues?q=php>
## Picolisp
- The original article: <https://picolisp.com/wiki/?TermuxPentiPicoLisp>
Related Issues:
<https://github.com/termux/termux-packages/issues?q=picolisp>
## Prolog
Package: swi-prolog
Description: Popular prolog implementation
Homepage: <https://swi-prolog.org/>
## Python
Package: python
Description: Python 3 interpreter
Package: python2
Description: Python 2 interpreter
Homepage: <http://python.org/>
Related Issues:
<https://github.com/termux/termux-packages/issues?q=python>
## Racket
Package: racket
Homepage: <https://racket-lang.org>
## Ruby
Package: ruby
Homepage: <https://www.ruby-lang.org/>
Related Issues:
<https://github.com/termux/termux-packages/issues?q=ruby>
## Rust
Package: rust
Description: The Rust compiler and Cargo package manager
Homepage: <https://www.rust-lang.org>
Related Issues:
<https://github.com/termux/termux-packages/issues?q=rust>
## Scala
Package: scala
Homepage: <https://www.scala-lang.org>
## Scheme
### TinyScheme
Package: tinyscheme
Description: Very small scheme implementation
Homepage: <http://tinyscheme.sourceforge.net/home.html>
### Guile
Package: guile
Homepage: <http://www.gnu.org/software/guile/>
## Smalltalk
Package: smalltalk
Description: Smalltalk-80 language implementation by GNU
Homepage: <http://smalltalk.gnu.org/>
## Swift
Package: swift
Description: Swift compiler
Homepage: <https://swift.org/>
## Tcl
Package: tcl
Homepage: <https://www.tcl.tk/>
## See Also
- [Development](Development)
- [Editors](Editors)
- [IDEs](IDEs)

View File

@ -0,0 +1,106 @@
The environment setup in Termux is similar to that of a modern Linux
distribution. However, running on Android implies several important
differences.
## Termux is not FHS compliant
*This is why Termux does not use official Debian or Ubuntu packages for
its environment.*
Termux does not follow [Filesystem Hierarchy
Standard](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)
unlike majority of Linux distributions. You cannot find directories like
/bin, /etc, /usr, /tmp and others at the usual locations. Thus, all
programs must be patched and recompiled to meet requirements of the
Termux environment otherwise they will not be able to find their
configuration files or other data.
You may have a problem executing scripts that have standard shebangs
(e.g. \#!/bin/sh). Use the `termux-fix-shebang` script to modify these
files before executing. Recent versions of Termux provide a special
package (termux-exec) which allows usage of standard she-bangs.
Most packages have shared library dependencies which are installed to
\$PREFIX/lib. On devices before Android 7, Termux exports the special
variable \$LD_LIBRARY_PATH which tells the linker where to find shared
library files. On Android 7 or higher, the DT_RUNPATH ELF header
attribute is used instead of LD_LIBRARY_PATH.
If you still need a classical Linux file system layout for some reason,
you may try to use **termux-chroot** from package 'proot':
`$ pkg install proot`
`$ termux-chroot`
`$ ls /usr`
`bin  doc  etc  include lib  libexec  share  tmp  var`
The **termux-chroot** utility may be very helpful if you use custom
software that requires standard paths like /tmp, /etc, /usr to be
available.
## Termux uses Bionic libc
![](images/Linux_executable_dynlinker_issue.png)
To have the best compatibility with Android OS and to remove the need to
maintain custom toolchains we compile all our packages with the Android
NDK. The resulting binaries are linked against the Bionic libc (files
libc.so, libm.so, libdl.so from /system/lib or /system/lib64).
Use of the libc provided by Android and FHS incompatibility make it
impossible to execute native packages copied from Linux distributions:
- Dynamically linked programs will not run because the linker is
expected in a nonexistent location (/lib) and libc ABI does not match.
- Statically linked programs (only networking ones) will not be able to
resolve DNS names. GNU libc normally doesn't allow static linking with
resolver. Also, the file /etc/resolv.conf does not exist on Android.
- On non-rooted Android 8 or newer, statically linked programs will not
run due to issues with seccomp filter.
- See also: [Common porting
problems](https://github.com/termux/termux-packages/wiki/Common-porting-problems)
However, these restrictions can be bypassed by setting up a Linux
distribution rootfs with [PRoot](PRoot).
## Root file system is stored as ordinary application data
The root file system and user home directory are located in a private
application data directory which lives on the /data partition. Paths to
these directories are exposed as \$PREFIX and \$HOME respectively.
You cannot move \$PREFIX to another location because all programs expect
that \$PREFIX will not be changed. Additionally, you cannot have
binaries, symlinks and other files from \$PREFIX on sdcard because that
file system does not support unix permissions, symlinks, sockets, etc...
**Important**: if you uninstall the Termux application or wipe its data,
directories \$PREFIX and \$HOME will be wiped too. Before doing this,
make sure that all important data is backed up.
## Termux is single-user
Android applications are sandboxed and have their own Linux user id and
SELinux label. Termux is no exception and everything within Termux is
executed with the same user id as the Termux application itself. The
username may look like `u0_a231` and cannot be changed as it is derived
from the user id by Bionic libc.
All our packages (except root-only ones) are patched to drop any
multiuser, setuid/setgid and other similar functionality. We also
changed default ports for server packages: ftpd, httpd and sshd have
their default ports set to 8021, 8080 and 8022 respectively.
You have free read-write access to all application components including
\$PREFIX. Be careful since it is very easy to break things by
accidentally deleting or overwriting files in \$PREFIX.
# See Also
- [Running Linux operating systems in Termux PRoot](PRoot)
- [Sharing data between Termux and other
applications](Sharing_Data)
- [Termux-exec](Termux-exec)
- [Common porting
problems](https://github.com/termux/termux-packages/wiki/Common-porting-problems)

26
docs/en/Editors.md Normal file
View File

@ -0,0 +1,26 @@
[Audio Editors](Audio_Editors) : 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.
<!-- -->
[Hex Editors](Hex_Editors) : A hex editor is a type of computer program that allows for manipulation of the fundamental binary data that constitutes a computer file.
<!-- -->
[Image Editors](Image_Editors) : Image editing encompasses the processes of altering images, whether they are digital photographs, traditional photochemical photographs, or illustrations. Traditional analog image editing is known as photo retouching, using tools such as an airbrush to modify photographs, or editing illustrations with any traditional art medium. Graphic software programs, which can be broadly grouped into vector graphics editors, raster graphics editors, and 3D modelers, are the primary tools with which a user may manipulate, enhance, and transform images. Many image editing programs are also used to render or create computer art from scratch such as [povray](https://github.com/termux/termux-packages/issues/202).
<!-- -->
[Stream Editors](Stream_Editors) : A Unix utility that parses and transforms text, using a simple, compact programming language. Options for doing stream editing include awk, node.js, perl and sed.
<!-- -->
[Text Editors](Text_Editors) : A system or program that allows a user to edit text. A text editor is a type of program used for editing plain text files. Text editors are provided with operating systems and software development packages, and can be used to change configuration files, documentation files and programming language source code.
<!-- -->
[Video Editors](Video_Editors) : With video editors various Video manipulation can be done, including: cutting, converting, splitting, joining ...
# See Also
- [IDEs](IDEs)
- [OCR](OCR)

33
docs/en/Emacs.md Normal file
View File

@ -0,0 +1,33 @@
Package: emacs
Description: An extensible, customizable, free/libre text editor — and
more.
Homepage: <https://www.gnu.org/software/emacs/>
![](images/Emacs.png)
# ERC
ERC is a powerful, modular, and extensible IRC client for Emacs. It is
distributed with Emacs since version 22.1. To use ERC type the following
in `emacs`: `M-x erc` +enter/return. `M-x` means `ALT+x` in Termux. Use
“irc.libera.chat” as the IRC server, “6697” as the port, choose a
nickname Just tap enter. Type `/join #termux` and presto, you can chat
on \#termux from emacs in your pocket. More at
<https://www.emacswiki.org/emacs/ERC>
![](images/ERCinTermux.png)
# Newsticker
- [Newsticker](Newsticker) provides a Feed Reader for Emacs.
![](images/Newsticker.png)
## See also
- [ERC
Manual](https://www.gnu.org/software/emacs/manual/html_mono/erc.html)
- [IDE](IDE)
- [IRC](IRC)

409
docs/en/FAQ.md Normal file
View File

@ -0,0 +1,409 @@
It is strongly suggested to start from these pages because FAQ does not
provide tips and tricks about Termux usage.
- [User Interface](User_Interface) - description of available
buttons, menus, etc.
- [Package Management](Package_Management) - how to install,
remove and upgrade packages.
- [Touch Keyboard](Touch_Keyboard) - Touch keyboard shortcuts
and extra keys layout configuration.
- [PRoot](PRoot) - Running Linux distributions inside Termux
(userspace chroot mode)
- [Recover a broken
environment](Recover_a_broken_environment) - Fixing broken
Termux installations.
- [Special:AllPages](Special:AllPages) - List of the all
available Wiki pages.
You may contribute to Termux project by making pull requests in our
[Github repositories](https://github.com/termux) or by improving Termux
Wiki.
## What is Termux
Termux is a [terminal
emulator](https://en.wikipedia.org/wiki/Terminal_emulator) for Android
OS with its own package ecosystem. There are more than 1000 packages for
various purposes, including code editors, compilers, etc.
## Is Termux an emulator
Termux is an emulator and is not. It does not emulate any system;
Programs are executed natively. On the other hand, it is a terminal
emulator in the same way as many common Linux distribution programs are;
e.g., GNOME terminal, Konsole, Xterm and many more.
[Terminal](https://en.wikipedia.org/wiki/Computer_terminal) is a
hardware device typically used before traditional desktop computers
appeared.
[Terminal emulator](https://en.wikipedia.org/wiki/Terminal_emulator) is
a software that emulates a display (not CPU or whole system) with
capabilities of specific hardware terminal.
## What are system requirements
Android OS of version 7.0 as minimum. Be prepared that Termux uses much
of internal storage, you are dealing with packages ported from Linux
distributions. That's 500 MB - 5 GB typically, in some cases more...
Everything depends on your use cases.
Also it is preferable to have AOSP Android, to avoid vendor-specific
quirks with process management and power-saving.
## Will Termux work on Android 11
In short: yes, it works on Android 11 and 12 beta.
Android security improvements in new versions often become a subject of
controversial discussions and recent \`execve()\` system call
restriction by SELinux configuration introduced with Android 10 was not
the exception. There lots of misinformation and conspiracy (aka "Google
want to kill Linux on Android") from people claiming themselves
"advanced users" about what is actually happening.
Applications built with target SDK level 29 (means compatibility with
Android 10) will no longer be able to execute data files. All
executables must be packaged within the APK file. That's a reasonable
restriction. Application must not be able to modify itself. Updates and
new features must come within the APK of newer version. However there is
a problem: Termux is technically a bridge between Android application
and Linux environments.
Fortunately, we chose to force use compatibility with Android 9 APIs
(SDK 28) at the cost of ability to publish updates on Google Play. That
is until we will workaround the issue. For now do not worry - it works
perfectly.
Termux also supports Android 12 but running the app on this version of
Android would kill phantom processes and crash the app, meaning spawning
several processes would randomly close the application unintentionally.
if you plan to upgrade your device to Android 12, upgrade at your own
risk!
Related issue: <https://github.com/termux/termux-app/issues/2366>
## Why does htop or netstat not work on my device
In order to stop leaking sensitive information via side channels,
Android has blocked access to certain interfaces in /proc. This is done
for your privacy.
Specifically:
- /proc/net/\*
- /proc/loadavg
- /proc/stat
- /proc/uptime
- /proc/version
- /proc/vmstat
- And few others.
Restrictions vary between Android OS versions. Thus Android 7 is less
restrictive than 8/9/10+. You can use root to bypass them.
Do not open issues in our repositories on this or complain how Google is
evil. We do not support such opinion or other Android-specific
conspiracy.
## Why does ps not show Android processes
Since Android 7, regular applications no longer can explore foreign
processes in /proc. This has been
[implemented](https://android.googlesource.com/platform/system/core/+/c39ba5a)
via hidepid=2 mount option.
Termux can list only its own processes. You can see more only under
rooted shell or ADB.
This restriction has weird effect on some programs. For example, some
processes like `ssh-agent` or `tor` daemons will no longer be visible
through `ps` and as result can't be terminated with `pkill `<NAME> or
`killall `<NAME> but only with `kill `<PID>.
## Why my Termux is 32bit while CPU supports 64bit
If Android OS reports support only of 32-bit ABIs, Termux will perform a
32-bit installation only. Its environment is not standalone and relies
on libraries provided by operating system. So if your system is 32-bit
only, you are out of luck. That is common issue with some device models
where manufacturer installed only 32-bit OS due to small system
partition.
## Can Termux be installed on the external storage
This can't be done, at least if your device is not rooted.
Termux requires a native Linux file system such as
[EXT4](https://en.wikipedia.org/wiki/Ext4) or
[F2FS](https://en.wikipedia.org/wiki/F2FS) for supporting special files
like [symbolic links](https://en.wikipedia.org/wiki/Symbolic_link),
[sockets](https://en.wikipedia.org/wiki/Unix_domain_socket) and Unix
file attributes. Neither
[FAT32](https://en.wikipedia.org/wiki/File_Allocation_Table) or exFAT
supports them. Furthermore, Android applies a special overlay to any
general purpose file storage which turns underlying file system into
FAT32 or exFAT-like in order to solve certain issues and provide a
better experience for average user.
If your device is rooted and you want to install Termux on external
storage, please refer to post on [Android Enthusiasts Stack
Exchange](https://android.stackexchange.com/questions/228443/can-the-termux-environment-be-put-on-an-external-sd-card).
## Any tips for using Termux
Here are the ones which should help you to survive in Termux shell:
- Learn shell scripting!
- Always do `pkg upgrade`!
- Do backups, always!
- Do not execute things which you do not know!
- Carefully read everything that has been printed to terminal!
## What do you use Termux for
You can do everything, specifically what you are able to do with it.
That is the case where you are limited mostly by your skills. Of course,
OS and device hardware restriction matter too, but they are
insignificant.
Here are just few ideas for Termux usage:
- Device automation with scripting and Termux Tasker add-on.
- File transfer & synchronization via syncthing, rsync, rclone, etc.
- [SSH](https://en.wikipedia.org/wiki/SSH_(Secure_Shell)) client
(dropbear, openssh).
- Programming (clang, python, vim, etc).
## Are there any Termux tutorials
Please check page [Getting started](Getting_started).
Note that while you can learn shell scripting with Termux, it is not the
best tool for this due to few [fundamental
differences](Differences_from_Linux) from the Linux
distributions.
## What are advantages of root in Termux
Root gains you control over system components. You will be able to
access freely all file systems, modify device firmware (ROM) as well as
perform fine tuning of kernel configuration, networking, etc.
Certain tools like cryptsetup, mount, nmap (advanced scan modes),
tcpdump require root access.
## What is a fake root
Fake root means exactly "fake root", i.e., not real root. It does not
provide any real superuser privileges. It just changes user ID and label
to assist in certain tasks.
There 2 ways to get a fake root:
- Package \`fakeroot\` - useful solely for packagers who need to create
archives with files having certain ownership and permissions. Of
course, using the real root in this case is overkill.
- Package \`proot\` - run a rootless Linux distribution "chroot".
Fake root will not help you to root your device. Neither will help you
to run a software requiring superuser privileges.
## Can I hack a social media with Termux
As some people say, there nothing impossible in the world, and that's
true in case of Termux and specifically this question. However we do not
provide any help on it - you are on your own.
Hacking and phishing topics are discouraged within all official Termux
communities.
## Where are Metasploit and Hydra packages
Packages Hashcat, Hydra, Metasploit and Sqlmap have been removed from
Termux repositories. We do not accept requests of hacking packages and
neither provide help for using or installing them.
## Why app from F-Droid cannot be installed
Open your Android settings --\> Applications and check whether you have
applications containing the word "Termux" in their name. If so,
uninstall all of them: Termux, Termux:API, Termux:Styling,
Termux:Widget, Termux:Boot and others. And yes, paid add-dons should be
uninstalled too.
After that you should be able to install Termux app from F-Droid.
## Why Termux add-ons on Google Play are paid even though their sources are on GitHub
This has been made as kind of donation. If you do not want to donate,
use application and add-ons from F-Droid or custom builds from sources.
Remember that open-source or free software does not mean that software
cannot be paid. This is not forbidden by licenses of our source code.
Also "free" means "freedom", in context of GNU GPL which even explicitly
states that free software can be paid as soon as sources are freely
available.
## How can I keep my data when reinstalling Termux
You need to archive contents of these directories:
`/data/data/com.termux/files/usr`
`/data/data/com.termux/files/home`
You can use utility `tar`. Before uninstalling the app, ensure that
archives are placed to safe location such as `/sdcard`.
## Repositories are down and return 403 404 errors
Switch to a working repository with \`termux-change-repo\`. You will
need to select repositories which do not work, if unsure what to
select - select everything.
<https://github.com/termux/termux-packages/issues/6726>
## How to open failsafe shell
There are 2 variants how to do that: 1. Open drawer by swiping
rightwards -\> long tap on "new session" -\> tap "failsafe". 2. Close
Termux app -\> long tap on icon -\> tap "failsafe".
See [Recover a broken
environment](Recover_a_broken_environment) for more
information on Termux recovery topic.
## How can I access device storage with Termux
You need to grant a *Storage access permission* to application. We
recommend to do that through command
`termux-setup-storage`
It will ask for permission and once it was granted, it will setup a
symlinks in directory \~/storage to standard directories like DCIM,
Download, etc.
Storage (shared) is usually accessible through:
- /storage/emulated/0
- /storage/self/primary
- \$HOME/storage/shared
External storage is restricted by Android OS. You can read files but
cannot write them, except ones located in Termux private directory
accessible through `$HOME/storage/external-1`. Termux cannot have write
access to external storage like file manager applications do.
If you are on Android 11 and storage suddenly has become inaccessible,
then revoke permission from Android settings and grant again.
## How can I hide the extra keys
Tap key combination *Volume Up + K*.
Alternate approach is to open drawer via swiping rightwards from the
left screen side and then long tap on "Keyboard" button.
## Why text appears only after hitting space
This is a keyboard-specific known issue. It happens because keyboard has
not internally reset input method type and tries to use unsupported
features like auto-correction or prediction.
In order to solve issue you need to use either a different keyboard or
run these commands:
`mkdir -p ~/.termux`
`echo "enforce-char-based-input = true" >> ~/.termux/termux.properties`
Restart application after making changes to "termux.properties" file.
## How do I get help for a specific package
Usually you can use next commands to get a brief usage of the utility:
`packagename -h`
`packagename --help`
More advanced information can be viewed by using a `man` tool. It can be
[installed](Package_Management) by
`pkg install man`
Here is an example how to view information for utility `ls`:
`man ls`
Tips, when reading a man page:
- Use q to quit
- Use space for next page
- /search for search
- n for repeat search
Sometimes utility name may not match the package name. If you
encountered a such package, consult its online home page to get a brief
introduction or use utility `apt-file` to list the available files
including utilities and documentation.
## Why does a compiled program show warnings
Warnings produced by dynamic linker about unused sections are safe. They
just notify developer that ELF header of executable file has extra
information which cannot be interpreted by current linker version. In
case of DT_FLAGS_1=0x8, it warns about RTLD_NODELETE ELF section.
Besides DT_FLAGS_1=0x8, there more types of ELF sections which are not
handled by Android linker.
To make this warning disappear you need to use utility
"termux-elf-cleaner" binary file and probably on all its dependencies.
`pkg install termux-elf-cleaner`
`termux-elf-cleaner ./myprogram`
`termux-elf-cleaner ./libmysharedlibrary.so`
Number of supported ELF sections increases with each Android OS version.
On Android \>7.0 you may not get such warnings.
## Can I use Termux packages in my own project
Yes, as Termux is open-source and uses a GNU GPL v3.0 and in some
components Apache-2.0 license, you can freely re-use existing components
as soon as you met the license requirements.
However license does not cover "free" use of our hosting capabilities
which are somewhat limited. You cannot use our package repositories in
your own project(s). Please build packages and host them yourself.
Get started with information on developer's wiki pages:
<https://github.com/termux/termux-packages/wiki>.
## How to run Termux commands from other application
Termux provides optional interface for processing command execution
requests made by third-party applications.
Detailed information with examples is available at
<https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent>.
## Can Termux run some commands automatically right after installation
No, this feature has not been implemented. Unconditional automated
execution of arbitrary commands (script on shared storage) also implies
a security issue.
Worth to note that Termux does not have storage access by default and we
have not re-considered this behavior.
Related pull request: <https://github.com/termux/termux-app/pull/1455>
# See Also
- [Community](Community)
- [Development](Development)

66
docs/en/FISH.md Normal file
View File

@ -0,0 +1,66 @@
FISH is a smart and user-friendly command line shell for macOS, Linux,
and the rest of the family.
The FISH shell init files are `~/.fish`, `$PREFIX/etc/fish/config.fish`
and more. See \`man fish\` and \`info fish\` for more information.
## Oh-My-Fish
Oh-my-fish of fish shell working without any known issue in termux, you
can install it with official manual in the repository
[here](https://github.com/oh-my-fish/oh-my-fish/blob/master/README.md).
Run `$ omf` to get some help installing plugin and theme.
## Fisherman
Fisherman is a fish-shell plugin manager.
### Installation
`curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs `[`https://git.io/fisher`](https://git.io/fisher)
### Usage
Install a plugin. `fisher z`
Install several plugins concurrently.
`fisher fzf edc/bass omf/thefuck omf/theme-bobthefish`
Install a specific branch. `fisher edc/bass:master`
Install a specific tag. `fisher edc/bass@1.2.0`
Install a gist.
`fisher `[`https://gist.github.com/username/1f40e1c6e0551b2666b2`](https://gist.github.com/username/1f40e1c6e0551b2666b2)
Install a local plugin. `fisher ~/path/to/my_plugin` Edit your fishfile
and run fisher to commit changes, e.g. install missing plugins.
`$EDITOR ~/.config/fish/fishfile fisher`
Show everything you've installed. <code>fisher ls @ my_plugin \# a local
plugin
- bobthefish \# current theme
` bass`
` fzf`
` thefuck`
` z`</code>
Show everything available to install. `fisher ls-remote`
Show additional information about plugins:
`fisher ls-remote --format="%name(%stars): %info [%url]\n"`
Update everything. `fisher up`
Update specific plugins. `fisher up bass z fzf`
Remove plugins. `fisher rm thefuck`
Remove all the plugins. `fisher ls | fisher rm`
Get help. `fisher help z`
Homepage: <https://fisherman.github.io>
Source code: <https://github.com/fisherman/fisherman>

2
docs/en/Fail-safe.md Normal file
View File

@ -0,0 +1,2 @@
1. REDIRECT [Recover a broken
environment](Recover_a_broken_environment)

172
docs/en/Getting_started.md Normal file
View File

@ -0,0 +1,172 @@
Termux is a terminal emulator application enhanced with a large set of
command line utilities ported to Android OS. The main goal is to bring
the Linux command line experience to users of mobile devices with no
rooting or other special setup required.
# How does it work
The terminal emulator is basically an application that launches the
command line program by using system call
[execve(2)](https://www.man7.org/linux/man-pages/man2/execve.2.html) and
redirecting standard input, output and error streams onto the display.
Most terminal applications available on Android OS work with a very
limited set of utilities which are usually provided either by the
operating system or other rooting tools such as Magisk. We have decided
to go further and port common software usually available on GNU/Linux
systems to Android OS.
Termux is neither a virtual machine nor any other kind of emulated or
simulated environment. All provided packages are cross-compiled with
Android NDK and only have compatibility patches to get them working on
Android. The operating system does not provide full access to its file
systems, so Termux cannot install package files into standard
directories such as /bin, /etc, /usr or /var. Instead, all files are
installed into the private application directory located at
`/data/data/com.termux/files/usr`
We call that directory "prefix" and usually refer to it as "\$PREFIX",
which is also an exported environment variable in the Termux shell. Note
that this directory cannot be changed or moved to an SD-Card because:
- The file system must have support for unix permissions and special
files such as symlinks or sockets.
- The prefix path is hardcoded into all binaries.
In addition to prefix, users can store files in the home directory (or
"\$HOME") available at
`/data/data/com.termux/files/home`
However, the file system is not the only difference from the traditional
Linux distributions. For more information, read [Differences from
Linux](Differences_from_Linux).
# What can I do with Termux?
There are a number of common use-cases for the Termux application:
- Data processing with Python.
- Programming in a development environment.
- Downloading and managing files and pages using time-established tools.
- Learning the basics of the Linux command line environment.
- Running an SSH client.
- Synchronizing and backing up your files.
Of course, usage is not limited to the topics listed above. There are
more than 1000 packages in our repositories. If these packages don't
have what you're looking for, you can compile your own - we have a
variety of build tools, including compilers for languages like C, C++,
Go, Rust. Interpreters for common languages like NodeJS, Python, Ruby
are available too.
Please note that Termux is not a rooting tool and will not give you root
privileges unless you are skilled enough to break the Android OS
security.
# Is root required
Normally Termux does not require device to be rooted. In fact it's
primarily targeted for non-root users.
You may want to root your device to:
- Modify a device's firmware.
- Manipulate the parameters of the operating system or kernel.
- Non-interactively install/uninstall APKs.
- Have full R/W access to all file systems on device.
- Have direct access to hardware devices such as BT/Wi-Fi modules or
serial lines (e.g. to access modem).
- Install a Linux distribution on top of Android through chroot (not
proot!) or containerization.
- Generally have "full" control over your device.
Otherwise root isn't necessary and is rather bad than good.
# Tips
Here are basic tips on how to use Termux and survive:
- Learn shell scripting!
- Always keep your packages up-to-date! Run command `pkg upgrade` on
regular basis or at least before installing a new package. Not
updating packages or downgrading them voids your warranty.
- Do backups, always! Without backups, you will be probably unable to
roll back if something goes wrong. Please note that software
developers should pay attention to backing up debfiles of used
compilers, interpreters or dependencies because Termux does not
provide older package versions and it is a rolling-release. Check
[Backing up Termux](https://wiki.termux.com/wiki/Backing_up_Termux)
for info on how to backup and restore.
- Do not execute things which you do not know! Review scripts downloaded
from the Internet. Always think about what you are typing into the
terminal.
- Carefully read everything that has been printed to the terminal!
Understanding the informational messages helps resolving issues which
may occur.
# Are there any tutorials
We are not capable of maintaining the whole documentation about Linux
commands, shell scripting and other general-purpose information so links
to external resources are provided instead.
**We strongly suggest that you avoid YouTube tutorials, especially
related to hacking.** There a lot of clickbait targeted at inexperienced
users. If you decide to follow them, ensure that you fully understand
the executed commands. Also always check the content of downloaded
files. If the content of downloaded scripts is obfuscated, that should
be an alarm about potentially unsafe content. Do not complain that
Termux has not fulfilled your expectations.
## Commands and Shell Scripting
Discover the commands and learn how to use shell effectively.
- <https://linuxjourney.com/>
- <http://mywiki.wooledge.org/BashGuide>
- <https://www.tldp.org/LDP/Bash-Beginners-Guide/html/>
These links may be useful for advanced users:
- <https://wiki-dev.bash-hackers.org/> reference with examples of Bash
built-in commands use,
- <https://debian-handbook.info/> The Debian Administrator's Handbook.
*When following tutorial examples, remember that Termux is not a Linux
distribution.* Some commands may not work, for example `ls /home`, due
to non-existent paths and other
[differences](Differences_from_Linux) Linux and Android have
regarding Termux distributions.
# How can I contribute?
The best ways to contribute are:
- Improving the Termux Wiki pages, i.e. by fleshing out sections that
could use additional information or by correcting errors in grammar.
- Submitting bug reports. Please only submit reports that are about
Termux packages or applications. Other errors should be submitted
elsewhere.
- Submitting package updates.
- Submitting pull requests with bug fixes and improvements.
All of the source code for Termux can be found at
<https://github.com/termux>.
# See also
- [FAQ](FAQ)
- [Development Environments](Development_Environments)
- [Editors](Editors)
- [Differences from Linux](Differences_from_Linux)
- [Package Management](Package_Management)
- [Recover a broken
environment](Recover_a_broken_environment)
- [Software](Software)

View File

@ -0,0 +1,259 @@
**This article is only applicable only to Termux installations running
on Android 7.0 or higher.**
Termux provides support for programs that use X Window System. However,
there no hardware acceleration for rendering and user will have to
install a third party application to view graphical output.
![](images/MtPaint_Fluxbox_vncviewer.jpg) To
use X11-enabled programs, please, make sure that at least one of the
following programs is installed:
- [VNC
Viewer](https://play.google.com/store/apps/details?id=com.realvnc.viewer.android) -
the best choice for interacting with graphical environment. Requires a
running VNC server.
<!-- -->
- [XServer
XSDL](https://play.google.com/store/apps/details?id=x.org.server) -
this one may be unstable but it provides a standalone Xorg server so
you don't have to setup VNC.
<!-- -->
- [Android XServer](https://github.com/nwrkbiz/android-xserver) - Only
implements the core X11 protocol. Shares clipboard between android /
X11 and includes a window manager.
## Enabling the X11 Repository
X11 packages are available in a **separate** APT repository. You can
enable it by running the following command:
`pkg install x11-repo`
It will automatically add appropriate sources.list file and PGP key.
To disable this repository, you need to uninstall package `x11-repo`.
## Setting up VNC
### Server
If you decided to use VNC for graphical output, follow these
instructions for properly setting up VNC server.
1\. Install package \`tigervnc\`:
`pkg install tigervnc`
2\. After installation, execute this:
`vncserver -localhost`
At first time, you will be prompted for setting up passwords:
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
Note that passwords are not visible when you are typing them and maximal
password length is 8 characters.
3\. If everything is okay, you will see this message:
New 'localhost:1 ()' desktop is localhost:1
Creating default startup script /data/data/com.termux/files/home/.vnc/xstartup
Creating default config /data/data/com.termux/files/home/.vnc/config
Starting applications specified in /data/data/com.termux/files/home/.vnc/xstartup
Log file is /data/data/com.termux/files/home/.vnc/localhost:1.log
It means that X (vnc) server is available on display 'localhost:1'.
4\. Finally, to make programs do graphical output to the display
'localhost:1', set environment variable like shown here (yes, without
specifying 'localhost'):
`export DISPLAY=":1"`
You may even put this variable to your bashrc or profile so you don't
have to always set it manually unless display address will be changed.
### Client
Here will be assumed that you use this Android VNC client: [VNC
Viewer](https://play.google.com/store/apps/details?id=com.realvnc.viewer.android)
(developed by RealVNC Limited).
![](images/Vncviewer_conn_info01.jpg) 1. Determine
port number on which VNC server listens. It can be calculated like this:
`5900 + {display number}`. So for display 'localhost:1' the port will be
5901.
2\. Now open the VNC Viewer application and create a new connection with
the following information (assuming that VNC port is 5901):
Address:
127.0.0.1:5901
Name:
Termux
- If you are using VNC client on a computer using the same network as
the phone does, make sure you correctly start a VNC session and know
the IP address of the device.
3\. Now launch it. You will be prompted for password that you entered on
first launch of 'vncserver'. Depending on packages you installed, you
may see either entirely black screen or terminal prompt (only if 'aterm'
is installed).
## Setting up XServer
Xserver setup is nearly same as for VNC. The only differences are that
you don't have to configure authentication and variable "DISPLAY" should
be set like
`export DISPLAY=localhost:0`
Note that you don't need to set variable "PULSE_SERVER" like application
suggests because Termux uses its own Pulseaudio package.
## Window Managers
When using Android XServer rather than Android XSDL these are optional.
### Fluxbox
![](images/Fluxbox_aterm_lynx.png)
Simplest way to get a working graphical environment is to install
Fluxbox:
`pkg install fluxbox`
It can be started automatically on VNC server startup. To do this, edit
file `~/.vnc/xstartup` as shown here:
``` bash
#!/data/data/com.termux/files/usr/bin/sh
## Fluxbox desktop.
# Generate menu.
fluxbox-generate_menu
# Start fluxbox.
fluxbox &
```
### Openbox
![](images/Openbox_aterm_geany.png)
Openbox requires a more complicated configuration than Fluxbox. Firstly
you need to install some packages:
`pkg install openbox pypanel xorg-xsetroot`
Put the following lines to your `~/.vnc/xstartup`:
``` bash
#!/data/data/com.termux/files/usr/bin/sh
# Start Openbox.
openbox-session &
```
Don't put anything else to file `~/.vnc/xstartup` but only lines shown
above since Openbox has own autostart script. It is located at
`${PREFIX}/etc/xdg/openbox/autostart` (or alternatively at
`~/.config/openbox/autostart`). Edit this file like here:
``` bash
# Make background gray.
xsetroot -solid gray
# Launch PyPanel.
pypanel &
```
## Desktop environment
It is possible to setup a full blown desktop environment in Termux. Only
XFCE, LXQt and MATE is supported.
### XFCE
![](images/Termux_XFCE.png)
Recommended way of installation is through metapackage and not the
separate components:
`pkg install xfce4`
VNC server startup configuration (`~/.vnc/xstartup`) should contain only
``` bash
#!/data/data/com.termux/files/usr/bin/sh
xfce4-session &
```
Additional recommended packages for installation:
- `netsurf` - Simple graphical web browser. Javascript is not supported.
- `xfce4-terminal` - Terminal emulator for XFCE. It is not included as
part of XFCE installation to allow use of `aterm` or `st`.
### LXQt
Recommended way of installation is through metapackage and not the
separate components:
`pkg install lxqt`
VNC server startup configuration (`~/.vnc/xstartup`) should contain only
``` bash
#!/data/data/com.termux/files/usr/bin/sh
lxqt-session &
```
Additional recommended packages for installation:
- `otter-browser` - Free and open source web browser that aims to
recreate aspects of Opera 12.x
- `qterminal` - Terminal emulator for LXQt. It is not included as part
of LXQt installation to allow use of `aterm` or `st`.
### MATE
As of right now, there is no MATE metapackage. So, you need to install
all required MATE components serperately
`pkg install mate-* marco`
VNC server startup configuration (`~/.vnc/xstartup`) should contain only
``` bash
#!/data/data/com.termux/files/usr/bin/sh
mate-session &
```
Additional recommended packages for installation:
- `netsurf` - Simple graphical web browser. Javascript is not supported.
- `mate-terminal` - Terminal emulator for MATE. It is not included as
part of MATE installation to allow use of `aterm` or `st`.
## Notes
\- Currently hardware acceleration is not supported by default.
## See also
- [Sources for X11 packages](https://github.com/termux/x11-packages)

250
docs/en/Hacking.md Normal file
View File

@ -0,0 +1,250 @@
On various Internet resources, Termux is recognized as utility
extremelly helpful for variety of purposes like hacking, phishing and
information gathering. This is possible due to availability of famous
pentesting software like [Metasploit
Framework](https://www.metasploit.com/),
[SQLMAP](https://github.com/sqlmapproject/sqlmap),
[Aircrack-NG](https://www.aircrack-ng.org/), [Nmap](https://nmap.org/)
and many others. Best experience could be achieved by using a rooted
device and [NetHunter](https://www.kali.org/docs/nethunter/) modified
kernel
([Base](https://www.kali.org/docs/nethunter/nethunter-kernel-2-config-1/),
[Net](https://www.kali.org/docs/nethunter/nethunter-kernel-3-config-2/),
[SDR](https://www.kali.org/docs/nethunter/nethunter-kernel-5-config-4/),
[USB](https://www.kali.org/docs/nethunter/nethunter-kernel-6-config-5/),
[Wi-Fi](https://www.kali.org/docs/nethunter/nethunter-kernel-4-config-3/)).
## Why Termux discourages hacking
*Spoiler: that is not about legit use of Termux for authorized
pentesting by security specialists, but rather about community activity
discrediting our project.*
![](images/Termux-is-not-for-hacking.png)
Termux has been created as general-purpose tool suitable for wide range
of use cases. People often use it for task automation via shell
scripting, SSH client, file synchronization and backup, running pocket
web server or development environment. Hacking is just only one of many
possible usage variants.
Unfortunately, the Internet is full of examples of the worst possible
Termux usages targeted on people excessively interested in privacy
violation, fraud, spying or stalking. Many of them are confusing and it
is quite hard to reproduce, especially people who are new to command
line software and scripting. We often getting requests for help on these
topics:![](images/Skids-are-messaging-us.png)
- How to hack Wi-Fi?
- How to hack Facebook?
- How to view private photos of specific Instagram account?
- How to track someone knowing phone number or IP address?
- How to create a web site clone for phishing?
- How to spam with SMS? Which SMS bomber is the best?
- How to install and use Kali Linux?
Obviously, this has nothing to do with legit penetration testing but
correlate with Termux-related information spread on social media. This
just gives no chance to be discover other use cases. Mature communities
of Linux enthusiasts often recognize our project as "script kiddie"
sandbox, rather than a serious project aiming to bring common free and
open source software to Android OS ecosystem. Not saying that this fact
makes troublesome to find qualified contributors to keep the project up.
Now, we have chosen to not participate in this nonsense. We do not
provide hacking tools in our repositories anymore - don't even ask for
them. Several common tools were removed, i.e. Metasploit, Hashcat,
Hydra, SQLMAP. Additionally, we have banned these topics in our
[community social media](Community): Hacking, Phishing,
Spying (including OSINT), Spamming and others describing activity
deliberately violating other person's privacy or is destructive.
## Terminology
**Script kiddie**: a person with poor knowledge in computer systems and
programming, who tries to use pentesting software for impressing friends
or gaining authority in computer enthusiast communities. Script kiddes
are known to often reject educational resources and other kind of help
on improving their skills, especially if learning path takes much time.
They need everything and now, claiming themselves as "newbies".
**Hacker**: a computer expert who uses their technical knowledge to
achieve a goal or overcome an obstacle, within a computerized system by
non-standard means - often referred as "power" or "advanced" users.
Hackers are not necessarily persons who uses their skills to breach
computer system security.
**Hacking**: exploiting weaknesses in computer systems or networks in
order to bypass defenses, gain unauthorized access to data or use
undocumented features and functionality.
**Ethical Hacking**: also known as "Penetration Testing" - a simulated
authorized cyber attack on computer units for evaluating the security
level of given system. All uncovered security issues are reported to the
owner of targeted system.
**White Hat**: a person that does ethical hacking, i.e. attacks system
with owner permission and helps to get rid of discovered security
issues.
**Black Hat**: a person that attacks the computer system without
permission with motive of destruction or personal profit.
**Phishing**: a type of fraudulent activity involving the psychological
manipulation of people to reveal confidential information. Since
phishing exploits the human nature instead of computer system
weaknesses, it cannot be considered as hacking and moreover, it is never
ethical.
**Exploit**: a fragment of data that is used to take advantage of a
software or hardware bug to cause unintended or unanticipated behavior
of computer system, leading to denial of service or attacker's privilege
escalation (e.g. gaining root permissions).
**DoS attack**: an attack causing denial of service through exhausting
computing resources (e.g. network throughput), exploiting software bug
causing abnormal CPU or memory usage or leading to crash of server
software.
**DDoS attack**: a denial-of-service attack performed by multiple
actors, usually by thousands of infected computer systems.
**Spamming**: sending unsolicited content to messaging systems and
social media for the purpose of commercial advertisement, phishing, etc.
Spam has nothing to do with hacking, but it doesn't mean that it is
acceptable activity.
**SMS bombing**: a destructive variant of spam, involving continuous
sending of large amount of SMS messages in a short time.
**Phone call bombing**: same as SMS bombing but with phone calls. Under
certain cases it can be even considered rather as DoS attack than just
spam.
**Brute force**: a way to guess the password by trying every possible
combination of characters, numbers and special symbols. Under perfect
conditions and without time constraints, this attack is almost always
successful. In reality, it is the most expensive way of gaining
unauthorized access as require trade off between consumed computing
resources (energy) and time.
**Root**: also known as Superuser - a special user account that has all
permissions and thus having full control over operating system. On
modern Linux-based systems its privileges are defined through
[capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html),
which can be revoked or selectively granted to non-root users. More
fine-grained root user permissions control can be achieved through
implementing mandatory access control policies, e.g. via SELinux.
**Rooting**: an activity aiming to gain root privileges on the device.
Can involve exploiting vulnerabilities in operating system, but often
this is done in a "legal" way through installing a custom firmware.
**Custom kernel**: an operating system kernel with extra features
besides bare minimum functionality. As Android typically uses a very
minimal Linux kernel build, in order to add support for custom hardware
you will need to compile your own.
**Monitor mode**: also known as RFMON (Radio Frequency MONitor) - a
functionality of wireless network interface adapter allowing to capture
radio frames. It is known to be either disabled or not implemented at
firmware level for the Wi-Fi adapters built into Android devices.
## How to be a hacker
Just using Kali Linux, especially in a chroot (proot) variants, will not
make you become a hacker automatically. This requires huge amount of
skills, which is not possible to acquire in a few days or weeks. This
takes years. If you are interested in how your roadmap will look like,
check this page: <https://www.wikihow.com/Become-a-Hacker>.
Once you think you are good enough for practice, here is a service for
proving your skills: <https://www.hackthebox.eu/>
By stepping on hacker's road, especially if decided to use Termux for
hacking purposes, you agree that you are on your own. Warranty is lost
at this point. We will not assist you in fixing issues, whether or not
related to your activity. If certain tools do not work or in any other
way malfunctioning, report issues to their distributors or original
authors.
Remember that Termux staff and community are not responsible for all
your hacking troubles, lost data, broken devices and other damage caused
by your usage of Termux.
## How to use Termux safely
Just follow these principles:
- When following a tutorial, make sure that you properly understand the
goal and every instruction. Understand what commands you are typing
and what they do.
- Use root permissions only when necessary. Never run everything,
including current shell, as root.
- Install software only from trusted sources. Remember that even open
source software can contain trojan functionality.
- If third-party script asks for credentials, most likely it is a scam.
Obfuscated third-party scripts are likely to be a scam too.
- Suspicious files should be sent to
[VirusTotal](https://www.virustotal.com/gui/home/upload).
- Do backups regularly, preferably encrypted and stored on at least 2
hardware disks (HDD, in worst case USB flash stick) and 1 copy on
cloud.
- Don't think you are very careful and thus bulletproof for scam,
phishing or trojans. Long random passwords, verified software and
brain in head are nice, but being prepared to be pwned at some day is
even better.
- Remember that YouTube tutorials are made for profit and entertainment,
but not suitable for education.
## Package requests
**We do not accept any requests for hacking packages.** Please do not
submit them because such requests will be deleted.
If you are interested in maintaining a repository of pentesting or
phishing packages, please do it on your own. We encourage community to
create own repositories with custom content rather than solely relying
on us and our services. Hacking package repositories are not eligible to
become "official" anyway.
## External resources
- [Top 10 Web Application Security
Risks](https://owasp.org/www-project-top-ten/)
- [Hack The Box - pentester's playground](https://www.hackthebox.eu/)
- [Courses by Offensive
Security](https://www.offensive-security.com/courses-and-certifications/)
## Tags
0day, abuse, account, adminfinder, aircrack-ng, aireplay-ng, airgeddon,
airodump-ng, andrax, androspy, anonymous, apt2, arp poisoning, b11, b3x,
b4bomber, backdoor, badmod, beef, black-hydra, blazy, bluespy, bomber,
brutal, brute, bruteforce, brutex, bully, burp suite, call, catphish,
cloner, combogen, combos, cowpatty, crack, cracking, credmap, cyberscan,
d00r, dark-fb, darkfly, ddos, decompile, deface, demozz, devploit,
disassemble, discord, dmitry, dsniff, eagleeye, easy_hack, eggshell,
email, evilginx, exploit, exploitdb, eyewitness, facebook, faraday,
findsploit, firefly, flood, followers, free, fsociety, genvirus, gmail,
goldeneye, grabber, h4ck, hack, hacker, hacklock, hakkuframework,
hashcat, hemera, hidden eye, i2p, infect, infoga, insta-bf, instagram,
instahack, intercept, ipdrone, ip-tracer, johntheripper, kali linux,
kalimux, katanaframework, kismet, krack, lazybee, lazymux, lazysqlmap,
lazy-termux, lucifer, maltego, malware, maskphish, masscan, mbomb, mdk3,
mdk4, metasploit, meterpreter, mitm, mitmproxy, morpheus, mrphish, msf,
netattack, nethunter, netscan, nexphisher, nikto, nmap, nmbf, onex,
osif, osint, oxidtools, parrot os, password, paybag, payload,
pentesting, phishing, phoneinfoga, ping, powersploit, pwn, pyrit,
rainbow tables, rang3r, rat, ravana, reaver, recovery, red hawk, root,
routersploit, rpcscan, saycheese, setoolkit, shellcode, shellnoob,
shodan, skipfish, slowloris, sms, sms bomber, sn1per, socialbox,
socialfish, spam, spammer, spazsms, spy, sql injection, sqlmap,
sqlninja, sslstrip, striker, tbomb, telegram, th3inspector, thc-hydra,
thc-ipv6, thebond, the-eye, thefatrat, theharvester, tool-x, tor,
trojan, udp flood, umbrella, virus, vpn, vulnerability, vulnscan,
vulscan, webscarab, websploit, webspoilt, weeman, wep, whatsapp, wi-fi,
wifi, wifibrutecrack, wifigod, wifi-hacker, wifiphisher, wifitap wifite,
wirespy, wordlist, wpa2, wpa3, wps, wpscan, xerxes, xss, xsser,
xsstrike, youtube, zirikatu, zphisher.

7
docs/en/Hardware.md Normal file
View File

@ -0,0 +1,7 @@
[Hardware Keyboard](Hardware_Keyboard): How to control Termux with a hardware keyboard
[Hardware Mouse](Hardware_Mouse) : How to control Termux with a hardware mouse
[Internal and External Storage](Internal_and_external_storage): Accessing Files in shared storage and on SD Card
# See Also
- [OTG](OTG)

View File

@ -0,0 +1,21 @@
The following shortcuts are available when using Termux with a hardware
(e.g. bluetooth) keyboard by combining them with Ctrl+Alt:
- C → Create new session
- R → Rename current session
- Down arrow (or N) → Next session
- Up arrow (or P) → Previous session
- Right arrow → Open drawer
- Left arrow → Close drawer
- M → Show menu
- U → Select URL
- V → Paste
- +/- → Adjust text size
- 1-9 → Go to numbered session
- K → Enable/Disable soft keyboard
# See Also
- [Hardware Mouse](Hardware_Mouse)
- [OTG](OTG)
- [Touch Keyboard](Touch_Keyboard)

View File

@ -0,0 +1,9 @@
You can almost do anything you can do with a hardware mouse on the
touchscreen, i.e. a virtual mouse.
# See Also
- [Screen Gestures](Screen_Gestures)
- [Hardware Keyboard](Hardware_Keyboard)
- [OTG](OTG)
- [Touch Keyboard](Touch_Keyboard)

24
docs/en/Hex_Editors.md Normal file
View File

@ -0,0 +1,24 @@
A hex editor is a type of computer program that allows for manipulation
of the fundamental binary data that constitutes a computer file.
<http://www.theunixschool.com/2011/06/3-different-ways-of-dumping-hex.html>
is about `hexdump`, `od` and `xxd`. See `man hexdump`, `man od` and
`man xxd` for more info...
## hexcurse
Use `pkg install hexcurse` to install a console hex editor.
Homepage: <https://github.com/LonnyGomes/hexcurse>
## ired
Use `pkg install ired` to install a minimalist hexadecimal editor.
Homepage: <https://github.com/radare/ired>
## radare2
Use `pkg install radare2` to install an advanced hexadecimal editor.
Homepage: <https://rada.re>

48
docs/en/IDEs.md Normal file
View File

@ -0,0 +1,48 @@
An integrated development environment (IDE) is a software application
that provides comprehensive facilities to computer programmers for
software development. An IDE normally consists of at least a source code
editor, build automation tools and a debugger.
# Codiad
![](images/Codiad.jpg)
[Codiad Web IDE](https://github.com/Codiad/Codiad) Codiad is a web-based
IDE framework with a small footprint and minimal requirements.
Codiad was built with simplicity in mind, allowing for fast, interactive
development without the massive overhead of some of the larger desktop
editors. That being said even users of IDE's such as Eclipse, NetBeans
and Aptana are finding Codiad's simplicity to be a huge benefit. While
simplicity was key, we didn't skimp on features and have a team of
dedicated developer actively adding more.
Rnauber has created a script for installing the web-based IDE/editor
codiad locally:
`   bash <(wget -qO- `[`https://gist.githubusercontent.com/rnauber/9f579d1480db4cc5a9a3c97c00c52fb9/raw/install_codiad.sh`](https://gist.githubusercontent.com/rnauber/9f579d1480db4cc5a9a3c97c00c52fb9/raw/install_codiad.sh)` )`
# Emacs
![](images/Emacs.png)
Package: emacs
Description: An extensible, customizable, free/libre text editor — and
more.
Homepage: <https://www.gnu.org/software/emacs/>
# Vim
![](images/Vim.png)
Package: vim
Description: Vim - the ubiquitous text editor
Homepage: <http://www.vim.org/>
# See Also
- [Editors](Editors)

99
docs/en/Image_Editors.md Normal file
View File

@ -0,0 +1,99 @@
Image editing encompasses the processes of altering images, whether they
are digital photographs, traditional photochemical photographs, or
illustrations. Traditional analog image editing is known as photo
retouching, using tools such as an airbrush to modify photographs, or
editing illustrations with any traditional art medium. Graphic software
programs, which can be broadly grouped into vector graphics editors,
raster graphics editors, and 3D modelers, are the primary tools with
which a user may manipulate, enhance, and transform images. Many image
editing programs are also used to render or create computer art from
scratch.
## dcraw
Raw digital camera images decoding utility
Homepage: <http://www.cybercom.net/~dcoffin/dcraw/>
## gifsicle
Tool for creating, editing, and getting information about GIF images and
animations
Homepage: <https://www.lcdf.org/gifsicle/>
## gmic
Description: imageman
Homepage: <http://gmic.eu>
## graphicsmagick
Collection of image processing tools
Homepage: <http://www.graphicsmagick.org/>
## graphicsmagick++
Format-independent image processing - C++ shared library
Homepage: <http://www.graphicsmagick.org/>
## imagemagick
Suite to create, edit, compose, or convert images in a variety of
formats
Homepage: <https://www.imagemagick.org/>
## netpbm
Toolkit for manipulation of graphic images, including conversion of
images between a variety of different formats
Homepage: <http://netpbm.sourceforge.net/>
## openjpeg-tools
Command-line tools using the JPEG 2000 library
Homepage: <http://www.openjpeg.org/>
## optipng
PNG optimizer that recompresses image files to a smaller size, without
losing any information
Homepage: <http://optipng.sourceforge.net/>
## Perl
<https://duckduckgo.com/?q=perl+image+manipulation+library+cpan>
## Python
<https://duckduckgo.com/?q=python+image+library>
The Python Imaging Library adds image processing capabilities to your
Python interpreter.
This library provides extensive file format support, an efficient
internal representation, and fairly powerful image processing
capabilities.
The core image library is designed for fast access to data stored in a
few basic pixel formats. It should provide a solid foundation for a
general image processing tool.
To install Pillow Termux <code> \$ pkg install libjpeg-turbo
\$ LDFLAGS="-L/system/lib/"
CFLAGS="-I/data/data/com.termux/files/usr/include/" pip install Pillow
</code>
<https://pillow.readthedocs.io/en/3.0.x/index.html>
## Ruby
<https://duckduckgo.com/?q=Ruby+image+library>

24
docs/en/Installation.md Normal file
View File

@ -0,0 +1,24 @@
You can install Termux from
[F-Droid](https://f-droid.org/repository/browse/?fdid=com.termux).
- [Instructions for F-Droid](Installing_from_F-Droid)
- [Instructions for installing addons](Installing_Addons)
## Google Play versions are deprecated
Since 2 November 2020, we are unable to publish new versions on Google
Play. Please use Termux from F-Droid.
Summary about Google Play Termux issues:
- Outdated repository URLs which lead to HTTP 403 and 404 errors.
- No application and add-ons updates anymore.
- Application has known issues which are fixed in F-Droid builds only.
## See Also
- [Addons](Addons)
- [Package Management](Package_Management)
- [Software](Software)

View File

@ -0,0 +1,23 @@
How to install Termux app from F-Droid:
1. Open F-Droid on your Android or Chrome OS device by tapping [this
link](https://f-droid.org/packages/com.termux/),
2. Tap Download APK,
3. Tap the downloaded APK on your device,
4. Tap allow installation of apps from unknown sources (you will want
to set this option anyway to be able to install [apps built on your
device](Working_with_APKs) in Termux),
5. Allow the installation to complete,
6. Once installed, you will see the Termux launcher on your home screen
and in your App Drawer. Tap the icon to fire up the application.
Please do not mix your installation of Termux between Google Play and
F-Droid. There are compatibility issues such as, "[Can't install
Termux:Api from google play on Nougat
\#53](https://github.com/termux/termux-api/issues/53)".
## See Also
- [Installation](Installation)
- [Disclaimer](Disclaimer)
- [Package Management](Package_Management)

View File

@ -0,0 +1,15 @@
Termux is able to catch several intents and execute shell scripts to act
upon them:
- Sharing single files with Termux.
Following handle will be executed:`~/bin/termux-file-editor`
- Opening in your popular editor by using a symbolic link:
`ln -s $PREFIX/bin/nvim ~/bin/termux-file-editor`
- Creating a handle by creating a file and changing the access rights:
1. `nano ~/bin/termux-file-editor`)
2. `chmod +x ~/bin/termux-file-editor`)
- URL sharing available in common apps (e.g. Youtube).
Following handle will be executed: `~/bin/termux-url-opener`
- Sharing a URL to be downloaded.
You can handle incoming URL by editing the content.
`yoursth-dl -f 'bestvideo[ext=mp4][height<=720]+bestaudio' --restrict-filenames -o '~/storage/downloads/%(title)s-%(id)s.%(ext)s' $1`

View File

@ -0,0 +1,146 @@
There are three main types of storage in Termux:
1. Internal storage: files put in \$HOME, available from inside Termux
or when explictly picked in a SAF-compatible file manager.
2. Shared storage: general purpose file storage available for the all
applications. You need to grant Termux storage access permission to
use it.
3. External storage: external SD cards or USB hard drives. Typically
read-only, except the Termux private directory.
See below for detailed feature comparison between storage types:
| Storage type | chmod/chown support | Special files support | Executables support | Access mode |
|----------------------------|---------------------|-----------------------|---------------------|-------------------|
| Internal (\$HOME/\$PREFIX) | yes | yes | yes | RW (app dir) |
| Shared storage | no | no | no | RW |
| External storage | no | no | no | RO / RW (app dir) |
Full read-write access to external SD cards and USB drives is available
only on rooted devices. *For those who are curious why some applications
can write on external storage without restriction: these applications
use a special APIs (Storage Access Framework) not available for command
line applications.*
Shared storage as well as external storage is not suitable for
installing software. Do not even try to move Termux directories like
\$HOME or \$PREFIX onto this kind of storage. Such option is only
available for advanced users who have rooted device and are familiar
with customization of partitions and file system on their external
storage. Use of adoptable storage will not make your external SD card
compatible with Termux, it is effectively same as shared storage
(EXT4/F2FS with FAT32/exFAT compatible overlay).
After creating directory `Android/data/com.termux`, through file manager
or by `termux-setup-storage`, you can access your external SD directly
in this folder. The remainder of the external SD card will not be
accessable from Termux unless you grant storage permission for Termux in
Android. **Important:** Please remember that if you uninstall Termux app
this directory will be deleted!
# Access shared and external storage
To access shared and external storage you need to run
`termux-setup-storage`. You will then be prompted to "Allow Termux
access photos, media and files on your device", which you should allow.
![](images/Termux-setup-storage.png)
Executing termux-setup-storage ensures:
1. That permission to shared storage is granted to Termux when running
on Android 6.0 or later.
2. That an app-private folder on external storage is created (if
external storage exists).
3. That a folder \$HOME/storage is created.
If you have Termux:API application and `termux-api` package installed,
you can use Android file picker to get any file from either shared or
external storage by using utility `termux-storage-get`. Example:
`termux-storage-get filename.txt`
File that has been chosen through file picker will be saved as
"filename.txt".
# \~/storage
The contents of the created \$HOME/storage folder are symlinks to
different storage folders:
- The root of the shared storage between all apps.
`~/storage/shared`
- The standard directory for downloads from e.g. the system browser.
`~/storage/downloads`
- The traditional location for pictures and videos when mounting the
device as a camera.
`~/storage/dcim`
- Standard directory in which to place pictures that are available to
the user.
`~/storage/pictures`
- Standard directory in which to place any audio files that should be in
the regular list of music for the user.
`~/storage/music`
- Standard directory in which to place movies that are available to the
user.
`~/storage/movies`
- Symlink to a Termux-private folder on external storage (only if
external storage is available).
`~/storage/external-1`
**Important**: do not clear Termux application data through Android OS
Settings if you have any files placed to `~/storage/external-1`. If you
do so, all data will be lost as Android will wipe all directories
associated with Termux.
![](images/FX_Termux_Home.jpg)
# Access Termux from a file manager
You can access Termux home directory (\$HOME) from the file manager
using Storage Access Framework and capable of accessing drives like USB
or external SD-card in read-write mode.
Few recommended file managers which can access Termux home directory:
- FX File Explorer:
<https://play.google.com/store/apps/details?id=nextapp.fx>
- Material Files:
<https://play.google.com/store/apps/details?id=me.zhanghai.android.files>
Steps to enable access to \$HOME are same as for any external drives:
open storage manager --\> select drive (Termux) --\> Select root
directory of storage.
You may use the following command to launch Android internal file
manager which also allows to transfer files between Termux and other
storage volumes:
`am start -a android.intent.action.VIEW -d "`[`content://com.android.externalstorage.documents/root/primary`](content://com.android.externalstorage.documents/root/primary)`"`
And you can also start the
\[<https://github.com/termux/termux-app/tree/master/app/src/main/java/com/termux/filepicker>\|
Termux Filepicker\] too:
`am start -a android.intent.action.OPEN_DOCUMENT -d /storage/emulated/0 -t '*/*'`
Alternate way would be direct access to Termux home directory with
Superuser permissions. That's possible only on rooted devices. However,
using root to work with Termux files is not recommended way as you can
easily mess up file access modes and SELinux contexts.

1
docs/en/Lua.md Normal file
View File

@ -0,0 +1 @@
[https://github.com/termux/termux-packages/issues?utf8=✓&q=Lua](https://github.com/termux/termux-packages/issues?utf8=✓&q=Lua)

42
docs/en/MariaDB.md Normal file
View File

@ -0,0 +1,42 @@
MariaDB is a community-developed, commercially supported fork of the
MySQL relational database management system.
## Installing package
Install package "mariadb":
`pkg install mariadb`
The installation should finish without any error. If error occurred, you
probably need to report the issue on
[Github](https://github.com/termux/termux-packages/issues).
The command shown above will also initialize the database with **2
all-privilege accounts** (introduced perhaps in MariaDB 10.4.x). The
first one is "root" which is inaccessible and the second one with name
of your Termux user (check with command `id -un` or `whoami`).
To enable access to root account, you need to login with your Termux
user name
`mysql -u $(whoami)`
and manually change password for root
`use mysql;`
`set password for 'root'@'localhost' = password('YOUR_ROOT_PASSWORD_HERE');`
`flush privileges;`
`quit;`
Verify that you are able to login as 'root' with `mysql -u root -p`. You
will need to provide password set in previous step.
## Using package
Whenever you want to access MySQL database manually through command line
or with some program (web application), you need to start MySQL server:
`mysqld_safe`
Then you should be able to connect to database, e.g. with
`mysql -u root -p`.

View File

@ -0,0 +1,21 @@
As of July 28 2019 packages ending in **-dev** will no longer exist.
These packages previously contained header files and other files needed
to build software on the device. As those files are small they are no
longer split out but instead merged into their main packages.
# Example: ncurses
Previously the package **ncurses-dev** contained the header files to
compile code using ncurses. This package no longer exists and the header
files are now a part of the **ncurses** package, along with the shared
libraries there.
# What to do?
- Run **pkg up** to update as normally. This will replace all **-dev**
packages with updated versions of main packages.
- If you are trying to execute scripts or follow a tutorial that tries
to install a **-dev** package, just remove the **-dev** suffix.
- If you have further questions, see the
[Community](Community) pages for where to ask questions.

82
docs/en/Node.js.md Normal file
View File

@ -0,0 +1,82 @@
Node.js is an open-source, cross-platform, JavaScript runtime
environment that executes JavaScript code outside a web browser. Node.js
lets developers use JavaScript to write command line tools and for
server-side scripting—running scripts server-side to produce dynamic web
page content before the page is sent to the user's web browser.
![](images/Vscode_screenshot.jpg)
In Termux Node.js is available in current and LTS versions which can be
installed by
`pkg install nodejs`
`pkg install nodejs-lts`
Only one of versions can be installed at a time.
**Due to our infrastructure limits, we do not provide older versions of
packages. If you accidentally upgraded to unsuitable NodeJS or
NodeJS-LTS version and do not have backups to rollback, do not complain!
We recommend doing backups of \$PREFIX for developers and other people
who rely on specific software versions.**
## Package management
After installing Node.js, `npm` package manager will be available. Here
is a quick tutorial about its usage.
Installing a new package globally:
`npm install -g {package name}`
Uninstall package installed globally:
`npm uninstall -g {package name}`
List packages installed globally:
`npm list -g`
If you working with Node.js packages project-wide, i.e. they should not
be installed into \$PREFIX, then remove command line argument `-g`.
In addition to `npm`, a Yarn package manager can be used as well. You
can install it with
`pkg install yarn`
When installing Node.js packages, it is highly recommended to have a
Termux packages `build-essential` and `python` to be installed - they
are needed for building native extensions.
## Node.js package installation tips and tricks
It is assumed that you have `build-essential` and `python` already
installed. Some modules may require `binutils` to be installed, as they
unable to pick LLVM utilities (e.g. llvm-ar) for some reason.
*Tip: help us to collect more information about installing Node.js
packages in Termux. You can also help to keep this information
up-to-date, because current instructions may eventually become
obsolete.*
<table>
<thead>
<tr class="header">
<th><p>Package</p></th>
<th><p>Description</p></th>
<th><p>Dependencies</p></th>
<th><p>Special Instructions</p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p>code-server</p></td>
<td><p>VS Code IDE in a web browser.<br />
<a
href="https://github.com/cdr/code-server">https://github.com/cdr/code-server</a></p></td>
<td><p>yarn</p></td>
<td><p><code>yarn global add code-server</code></p></td>
</tr>
</tbody>
</table>

32
docs/en/OCR.md Normal file
View File

@ -0,0 +1,32 @@
Available OCR (Optical Character Recognition) packages for Termux
available on-the-fly are:
Package: ocrad 
Description: Optical Character Recognition program based on a feature
extraction method 
Homepage:<http://www.gnu.org/software/ocrad/ocrad.html>
Package: ocrad-dev 
Description: Development files for ocrad 
Homepage:<http://www.gnu.org/software/ocrad/ocrad.html>
Package: tesseract 
Description: Tesseract is probably the most accurate open source OCR
engine available  Homepage: https://github.com/tesseract-ocr/tesseract
Package: tesseract-dev 
Description: Development files for tesseract 
Homepage: https://github.com/tesseract-ocr/tesseract
There probably are more OCR programs available as [Ruby
gems,](Ruby) [Python pips,](Python) [Perl
cpan](Perl) and similar.
# See Also
- [Other Package
Managers](Package_Management#Other_Package_Managers)

19
docs/en/OTG.md Normal file
View File

@ -0,0 +1,19 @@
![](images/USB-OTG.jpg)
USB On-The-Go, often abbreviated to USB OTG or just OTG, is a
specification first used in late 2001 that allows USB devices, such as
tablets or smartphones, to act as a host, allowing other USB devices,
such as USB flash drives, digital cameras,
[mice](Hardware_Mouse) or
[keyboards](Hardware_Keyboard), to be attached to them. Use
of USB OTG allows those devices to switch back and forth between the
roles of host and device. For instance, a mobile phone may read from
removable media as the host device, but present itself as a USB Mass
Storage Device when connected to a host computer.
# See Also
- [Hardware Keyboard](Hardware_Keyboard)
- [Hardware Mouse](Hardware_Mouse)
- [OTG issues at Termux
Packages.](https://github.com/termux/termux-packages/issues?utf8=%E2%9C%93&q=OTG)

139
docs/en/PRoot.md Normal file
View File

@ -0,0 +1,139 @@
PRoot is a user-space implementation of
[chroot](https://en.m.wikipedia.org/wiki/Chroot), mount --bind, and
binfmt_misc. This means that users don't need any privileges or setup to
do things like using an arbitrary directory as the new root filesystem,
making files accessible somewhere else in the filesystem hierarchy, or
executing programs built for another CPU architecture transparently
through QEMU user-mode.
You can install PRoot with this command:
`pkg install proot`
Termux maintains its own version of PRoot, which is compatible with the
latest Android OS versions. You can find its source code at
<https://github.com/termux/proot>.
**Important note**: PRoot can make program to appear under root user id
due to faking system call arguments and return values, but it does not
provide any way for the real privilege escalation. Programs requiring
real root access to modify kernel or hardware state will not work.
## PRoot vs Chroot
The main different of [chroot](https://en.m.wikipedia.org/wiki/Chroot)
from PRoot is that it is native. Unlike PRoot, it does not use
`ptrace()` for hijacking system call arguments and return values to fake
the visible file system layout or user/group IDs. It does not cause
overhead and works without issues on any device. However it requires
superuser permissions.
If you have rooted device and want to have a better experience with
using the Linux distributions in Termux, then use `chroot`. In this case
get started with [Linux
Deploy](https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy)
app for automated distribution installation. Things like shell can be
used from Termux of course.
## General usage information
The main purpose of PRoot is to run the Linux distributions inside
Termux without having to root device. Simplest way to start a shell in a
distribution chroot is:
unset LD_PRELOAD
proot -r ./rootfs -0 -w / -b /dev -b /proc -b /sys /bin/sh
Where:
- `unset LD_PRELOAD` - Termux-exec, execve() hook, conflicts with PRoot.
- `-r ./rootfs` - option to specify the rootfs where Linux distribution
was installed.
- `-0` - tells PRoot to simulate a root user which expected to be always
available in Linux distributions. This option will allow you to use
package manager.
- `-b /dev -b /proc -b /sys` - make file systems at /dev, /proc, /sys
appear in the rootfs. These 3 bindings are important and used by
variety of utilities.
- `/bin/sh` - a program that should be executed inside the rootfs.
Typically a shell.
You can learn more about options supported by PRoot by executing
`proot --help`.
## Installing Linux distributions
Termux provides a package
[proot-distro](https://github.com/termux/proot-distro) which takes care
of management of the Linux distributions inside Termux. You can install
this utility by executing
`pkg install proot-distro`
For now it supports these distributions:
- Alpine Linux (edge)
- Arch Linux / Arch Linux 32 / Arch Linux ARM
- Debian (stable)
- Fedora 35
- Manjaro AArch64
- OpenSUSE (Tumbleweed)
- Ubuntu (22.04)
- Void Linux
To install distribution, just run this command (assuming proot-distro is
installed):
`proot-distro install `<alias>
where "<alias>" should be replaced by chosen distribution, e.g.
"alpine". Note that it is expected that you have a stable Internet
connection during installation, otherwise download may fail.
After installation, you can start a shell session by executing next
command:
`proot-distro login `<alias>
Here is a basic overview of the available proot-distro functionality:
- `proot-distro list` - show the supported distributions and their
status.
- `proot-distro install` - install a distribution.
- `proot-distro login` - start a root shell for the distribution.
- `proot-distro remove` - uninstall the distribution.
- `proot-distro reset` - reinstall the distribution.
Run `proot-distro help` for built-in usage information. Note that each
of commands (with exception of "list") has own built-in usage
information which can be viewed by supplying "--help" as argument. More
detailed explanation about available functions you can find at project
page: <https://github.com/termux/proot-distro#functionality-overview>
Example of installing Debian and launching shell:
`proot-distro install debian`
`proot-distro login debian`
### Community scripts
The ways of installation of Linux distributions in Termux are not
limited to `proot-distro` only. There are lots of community created
scripts, though their quality may be lower than that of the official
Termux utilities provide and third-party stuff is generally out of the
official Termux support.
Here is the list of some community-provided scripts:
- Alpine Linux - <https://github.com/Hax4us/TermuxAlpine>
- Arch Linux - <https://github.com/TermuxArch/TermuxArch>
- Debian - <https://github.com/sp4rkie/debian-on-termux>
- Fedora - <https://github.com/nmilosev/termux-fedora>
- Kali Nethunter - <https://github.com/Hax4us/Nethunter-In-Termux>
- Slackware - <https://github.com/gwenhael-le-moine/TermuxSlack>
- Ubuntu - <https://github.com/Neo-Oli/termux-ubuntu>
If you decide to use third-party scripts, take the responsibility of
potential risks on your own.

View File

@ -0,0 +1,158 @@
Termux uses apt and dpkg for package management, similar to Ubuntu or
Debian.
## Limitations
Termux does not support use of packages from the Debian, Ubuntu and
other Linux distribution repositories. For this reason do not attempt
put these ones into your sources.list or manually installing their .deb
files. See [Differences from Linux](Differences_from_Linux)
to learn why.
Additional restrictions:
- Only single architecture is supported at the moment. You can't have
both 64 and 32 bit packages installed at the same time.
- Apt usage under root is restricted to prevent messing up ownership and
SELinux labels on Android /data partition.
- Downgrading is not supported. In order to reclaim disk space, we do
not keep history of package versions.
## Using the package manager
We strongly recommend to use a `pkg` utility instead of `apt` directly.
It is a wrapper that performs a number of tasks:
- Provides command shortcuts. Use "pkg in" instead of "pkg install" or
"apt install".
- Automatically runs "apt update" before installing a package if
necessary.
- Performs some client side repository load-balancing by automatically
switching mirrors on a regular basis. *That is important to prevent us
hitting quota limit on hosting.*
Installing a new package:
`pkg install package-name`
It is highly recommended to upgrade existing packages before installing
the new one. You can install updates by running this command:
`pkg upgrade`
Additionally, we suggesting to check for updates at least once a week.
Otherwise there is a certain risk that during package installation or
upgrade you will encounter issues.
Removing the installed package:
`pkg uninstall package-name`
This will remove package but modified configuration files will be left
intact. If you want to remove them, use `apt purge` instead.
See below for additional supported commands:
| Command | Description |
|---------------------------|--------------------------------------------|
| `pkg autoclean` | Remove outdated .deb files from the cache. |
| `pkg clean` | Remove all .deb files from the cache. |
| `pkg files `<package> | List files installed by specified package. |
| `pkg list-all` | List all available packages. |
| `pkg list-installed` | List currently installed packages. |
| `pkg reinstall `<package> | Re-install specified package. |
| `pkg search `<query> | Search package by query. |
| `pkg show `<package> | Show information about specific package. |
## Official repositories
The main Termux repository is accessible through
<https://packages.termux.org/apt/termux-main/>.
We have some optional repositories which provide content on specific
topic and can be enabled by installing packages with name ending in
`-repo`.
List of current optional repositories:
| Repository | Command to subscribe to repository |
|--------------------------------------------------------------------------|------------------------------------|
| [game-packages](https://github.com/termux/game-packages) | `pkg install game-repo` |
| [science-packages](https://github.com/termux/science-packages) | `pkg install science-repo` |
| [termux-root-packages](https://github.com/termux/termux-root-packages) | `pkg install root-repo` |
| [x11-packages](https://github.com/termux/x11-packages) (Android 7+ only) | `pkg install x11-repo` |
Packages for our official repositories are built from scripts located in
[github.com/termux/](https://github.com/termux) and are maintained and
signed by member of the [Termux developer
team](https://github.com/orgs/termux/people). Public keys for verifying
signatures are provided in package `termux-keyring`. For more
information about how the repositories are signed, see
[termux-keyring](termux-keyring).
The mirrors of Termux apt repositories are available. See up-to-date
information about them [on
Github](https://github.com/termux/termux-packages/wiki/Mirrors).
You can pick a mirror by using utility `termux-change-repo`.
## Community repositories
In addition to the official repositories, there are repositories hosted
by community members. You are welcome to host own Termux repository too.
You can create own repository by using
[termux-apt-repo](https://github.com/termux/termux-apt-repo) from the
command line and [Github Pages](https://pages.github.com/) as hosting.
Be aware that Github has a strict limit of 100 MB per file and if your
repository exceeds total size of 1 GB, you might receive a polite email
from GitHub Support requesting that you reduce the size of the
repository. So if you have really big packages you may want to use a
different hostings. Choose hostings according to filetypes, for example,
videos can be hosted at <https://YouTube.com> or similar.
### By [its-pointless](https://github.com/its-pointless/its-pointless.github.io)
Repository of this community member includes **gcc**, **gfortran**,
**octave**, **r-cran** (R language), **scipy** and lots of games!
To add this repository, execute:
curl -LO https://its-pointless.github.io/setup-pointless-repo.sh
bash setup-pointless-repo.sh
The script essentially installs gnupg on your device, downloads and adds
a public key to your apt keychain ensuring that all subsequent downloads
are from the same source.
## Package requests
Packages can be requested at
<https://github.com/termux/termux-packages/issues>. Note that your
opened issue with request can be moved to another repository, like
[termux-root-packages](https://github.com/termux/termux-root-packages)
or [x11-packages](https://github.com/termux/x11-packages) if it is not
suitable for the main repository.
Please ensure that you have read our [Packaging
Policy](https://github.com/termux/termux-packages/blob/master/CONTRIBUTING.md#a-note-about-package-requests).
### Other package managers
Some programming languages have their own package managers. We tend not
to package things installable with this ones due to issues when
cross-compiling them in our build environment.
- [Node.js Package Management (npm)](Node.js)
- [Perl Package Management (cpan)](Perl)
- [Python Package Management (pip)](Python)
- [Ruby Package Management (gem)](Ruby)
- [TeX Live Package Management (tlmgr)](TeX_Live)
- [Rust Package Manager
(Cargo)](Development_Environments#Rust)
# See Also
- [Backing up Termux](Backing_up_Termux)
- [Building packages](Building_packages)

15
docs/en/Package_Tips.md Normal file
View File

@ -0,0 +1,15 @@
Some packages are troublesome to get working or configure in Termux.
Follow the individual page to get installation and configuration help.
- [mariadb](MariaDB)
- [postgresql](postgresql)
If you are interested in resolving issues regarding packages, please
post at <https://github.com/termux/termux-packages/issues> and search
your topic before posting to avoid duplicates, please. You might even
find your question answered before asking.
# See Also
[Package Management: Other
PackagenManagers](Package_Management#Other_Package_Managers)

26
docs/en/Perl.md Normal file
View File

@ -0,0 +1,26 @@
Perl is a high-level, general-purpose, interpreted, dynamic programming
language. It is used for system administration, network programming,
finance, bioinformatics, and other applications. It has been nicknamed
"the Swiss Army chainsaw of scripting languages" because of its
flexibility and power, and also its ugliness.
In Termux Perl can be installed by executing this command
`pkg install perl`
Note that Termux provides only Perl 5 currently.
## Package management
Perl uses `cpan` utility for module management. However we recommend to
install `cpanminus` for installing modules easier:
`cpan App::cpanminus`
Now you can install Perl modules using
`cpanm Module::Name`
It is highly recommended to have `build-essential` Termux package to be
installed `pkg install build-essential`, so Perl will be able to build
native extensions.

28
docs/en/Postgresql.md Normal file
View File

@ -0,0 +1,28 @@
Create skeleton database
`mkdir -p $PREFIX/var/lib/postgresql`
`initdb $PREFIX/var/lib/postgresql`
Starting the database
`pg_ctl -D $PREFIX/var/lib/postgresql start`
Similarly stop the database using
`pg_ctl -D $PREFIX/var/lib/postgresql stop`
Create User
`$ createuser --superuser --pwprompt yourUserName`
Create your database:
`$ createdb mydb`
Open your database
`$ psql mydb`
You will now see the promt
`mydb=#`

275
docs/en/Python.md Normal file
View File

@ -0,0 +1,275 @@
Python is an interpreted, high-level, general-purpose programming
language. Created by Guido van Rossum and first released in 1991,
Python's design philosophy emphasizes code readability with its notable
use of significant whitespace. Its language constructs and
object-oriented approach aim to help programmers write clear, logical
code for small and large-scale projects.
In Termux Python v3.x can be installed by executing
`pkg install python`
Legacy, deprecated version 2.7.x can be installed by
`pkg install python2`
**Warning**: upgrading major/minor version of Python package, for
example from Python 3.8 to 3.9, will make all your currently installed
modules unusable. You will need to reinstall them. However upgrading
patch versions, for example from 3.8.1 to 3.8.2, is safe.
**Due to our infrastructure limits, we do not provide older versions of
packages. If you accidentally upgraded to unsuitable Python version and
do not have backups to rollback, do not complain! We recommend doing
backups of \$PREFIX for developers and other people who rely on specific
software versions.**
## Package management
After installing Python, `pip` (`pip2` if using python2) package manager
will be available. Here is a quick tutorial about its usage.
Installing a new Python module:
`pip install {module name}`
Uninstalling Python module:
`pip uninstall {module name}`
Listing installed modules:
`pip list`
When installing Python modules, it is highly recommended to have a
package `build-essential` to be installed - some modules compile native
extensions during their installation.
A few python packages are available from termux's package manager (for
python3 only), and should be installed from there to avoid compilation
errors. This is the case for:
- numpy, `pkg install python-numpy`
- electrum, `pkg install electrum`
- opencv, `pkg install opencv-python`
- asciinema, `pkg install asciinema`
- matplotlib, `pkg install matplotlib`
- cryptography, `pkg install python-cryptography`
## Python module installation tips and tricks
It is assumed that you have `build-essential` or at least `clang`,
`make` and `pkg-config` installed.
It also assumed that `termux-exec` is not broken and works on your
device. Environment variable `LD_PRELOAD` is not tampered or unset.
Otherwise you will need to patch modules' source code to fix all
shebangs!
*Tip: help us to collect more information about installing Python
modules in Termux. You can also help to keep this information
up-to-date, because current instructions may eventually become
obsolete.*
<table>
<thead>
<tr class="header">
<th><p>Package</p></th>
<th><p>Description</p></th>
<th><p>Dependencies</p></th>
<th><p>Special Instructions</p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p>gmpy2</p></td>
<td><p>C-coded Python modules for fast multiple-precision
arithmetic.<br />
<a
href="https://github.com/aleaxit/gmpy">https://github.com/aleaxit/gmpy</a></p></td>
<td><p>libgmp libmpc libmpfr</p></td>
<td></td>
</tr>
<tr class="even">
<td><p>lxml</p></td>
<td><p>Bindings to libxml2 and libxslt.<br />
<a href="https://lxml.de/">https://lxml.de/</a></p></td>
<td><p>libxml2 libxslt</p></td>
<td></td>
</tr>
<tr class="odd">
<td><p>pandas</p></td>
<td><p>Flexible and powerful data analysis / manipulation library for
Python.<br />
<a
href="https://pandas.pydata.org/">https://pandas.pydata.org/</a></p></td>
<td></td>
<td><p><code>export CFLAGS="-Wno-deprecated-declarations -Wno-unreachable-code"</code><br />
<code>pip install pandas</code></p></td>
</tr>
<tr class="even">
<td><p>pynacl</p></td>
<td><p>Bindings to the Networking and Cryptography library.<br />
<a
href="https://pypi.python.org/pypi/PyNaCl">https://pypi.python.org/pypi/PyNaCl</a></p></td>
<td><p>libsodium</p></td>
<td></td>
</tr>
<tr class="odd">
<td><p>pillow</p></td>
<td><p>Python Imaging Library.<br />
<a
href="https://pillow.readthedocs.io/en/stable/">https://pillow.readthedocs.io/en/stable/</a></p></td>
<td><p>libjpeg-turbo libpng</p></td>
<td><p>64-bit devices require running
<code>export LDFLAGS="-L/system/lib64"</code> before pip
command.</p></td>
</tr>
<tr class="even">
<td><p>pyzmq</p></td>
<td><p>Bindings to libzmq.<br />
<a
href="https://pyzmq.readthedocs.io/en/latest/">https://pyzmq.readthedocs.io/en/latest/</a></p></td>
<td><p>libzmq</p></td>
<td><p>On some devices the libzmq library can't be found by setup.py. If
<code>pip install pyzmq</code> does not work, try:
<code>pip install pyzmq --install-option="--libzmq=/data/data/com.termux/files/usr/lib/libzmq.so"</code></p></td>
</tr>
</tbody>
</table>
### Advanced installation instructions
Some Python modules may not be easy to install. Here are collected
information on how to get them available in your Termux.
#### Tkinter
Tkinter is splitted of from the `python` package and can be installed by
`pkg install python-tkinter`
We do not provide Tkinter for Python v2.7.x.
Since Tkinter is a graphical library, it will work only if X Windows
System environment is installed and running. How to do this, see page
[Graphical Environment](Graphical_Environment).
### Installing Python modules from source
Some modules may not be installable without patching. They should be
installed from source code. Here is a quick how-to about installing
Python modules from source code.
1\. Obtain the source code. You can clone a git repository of your
package:
git clone https://your-package-repo-url
cd ./your-package-repo
or download source bundle with `pip`:
pip download {module name}
unzip {module name}.zip
cd {module name}
2\. Optionally, apply the desired changes to source code. There no
universal guides on that, perform this step on your own.
3\. Optionally, fix the all shebangs. This is not needed if
`termux-exec` is installed and works correctly.
find . -type f -not -path '*/\.*' -exec termux-fix-shebang "{}" \;
4\. Finally install the package:
python setup.py install
## Troubleshooting
### pip doesn't read config in `~/.config/pip/pip.conf`
A.k.a.
- virtualenv doesn't read config in
`~/.config/virtualenv/virtualenv.ini` / stores its data in
`/data/data/com.termux/files/virtualenv` .
<!-- -->
- pip / virtualenv doesn't follow freedesktop `$XDG_CONFIG_HOME` /
`$XDG_DATA_HOME` / `$XDG_CACHE_HOME` .
<!-- -->
- pylint / black doesn't store its cache in `~/.cache` but stores its
cache in `/data/data/com.termux/cache` .
All of above are because of
[platformdirs](https://github.com/platformdirs/platformdirs).
Platformdirs aims to replace
[appdirs](https://github.com/ActiveState/appdirs), since [pip
v21.3.0](https://github.com/pypa/pip/pull/10202) and [virtualenv
v20.5.0](https://github.com/pypa/virtualenv/pull/2142), they started to
use platformdirs instead of appdirs. Appdirs doesn't do anything else on
Android, it just follows freedesktop standards. But platformdirs is
different, it takes termux as a simple Android app but not a unix
evironment.
See details: [platformdirs issue
70](https://github.com/platformdirs/platformdirs/issues/70).
It it predictable that all packages using platformdirs can't behave well
on termux, see: [1](https://libraries.io/pypi/platformdirs/dependents).
Before [PR 72](https://github.com/platformdirs/platformdirs/pull/72) is
merged, the only way to fix it is to patch it manually.
There are two copies of platformdirs we need to patch:
1. Pip vendors its own copy in
`$PREFIX/lib/pythonX.Y/site-packages/pip/_vendor`.
2. Platformdirs is installed as a dependency in
`$PREFIX/lib/pythonX.Y/site-packages`. (If it was installed by
`pip install --user`, the path is
`~/.local/lib/pythonX.Y/site-packages`.)
Every time after we upgrade pip or platformdirs, we need to patch it
again.
Patch for platformdirs before v2.5.0:
--- __init__.py.bak 2022-03-09 02:21:09.888903935 +0800
+++ __init__.py 2022-04-02 02:37:05.802427311 +0800
@@ -18,7 +18,7 @@
def _set_platform_dir_class() -> type[PlatformDirsABC]:
- if os.getenv("ANDROID_DATA") == "/data" and os.getenv("ANDROID_ROOT") == "/system":
+ if os.getenv("ANDROID_DATA") == "/data" and os.getenv("ANDROID_ROOT") == "/system" and os.getenv("SHELL") is None:
module, name = "pip._vendor.platformdirs.android", "Android"
elif sys.platform == "win32":
module, name = "pip._vendor.platformdirs.windows", "Windows"
Patch for platformdirs v2.5.0 or later:
--- __init__.py.bak 2022-03-09 02:29:15.338903750 +0800
+++ __init__.py 2022-04-02 02:44:38.992427138 +0800
@@ -25,6 +25,10 @@
from platformdirs.unix import Unix as Result
if os.getenv("ANDROID_DATA") == "/data" and os.getenv("ANDROID_ROOT") == "/system":
+
+ if os.getenv("SHELL") is not None:
+ return Result
+
from platformdirs.android import _android_folder
if _android_folder() is not None:
We can simply patch it by:
patch ~/../usr/lib/python3.10/site-packages/pip/_vendor/platformdirs/__init__.py -i platformdirs.patch
Notice that the two copies may be different versions, so they need
different patches. For example, pip v21.3 and v22.0 use platformdirs
v2.4, and the lastest version (on 2022-04-02) is v2.5.1.

View File

@ -0,0 +1,75 @@
![](images/Start_failsafe_session.mp4)
![](images/Termux-failsafe-recover.mp4)
If Termux exits immediately after launch or cannot properly start shell,
it is likely that your environment is broken. The cause of which is most
likely a a fatal error in a dotfile read by your shell, which causes it
to immediately exit. To recover from such errors Termux provides a
Failsafe Session.
## Launching a Failsafe Session
1\. Close all sessions of Termux application.
2\. Either long-press the termux launcher icon and then press "failsafe"
(only works on recent android versions) or long-press the "new session"
button in the left drawer inside the termux app.
You are now in a Failsafe Session. It launches the default Shell of
Android `/system/bin/sh` with access to the Termux directory. Despite
the fact that Android shell is very limited, you can still save your
files to /sdcard or perform some recovery steps.
## Fixing the Problem
Now that you have basic access to Termux you can fix the problems. If
you don't know which dotfile is broken read the section about about
possible broken dotfiles below. It's most likely the one you tinkered
with the last. Once you have identified the broken dotfile, move it to a
new name. Example:
`mv .profile .profile.bak`
Now you can try to launch a normal session again. If it still doesn't
work, you'll have to check the other dotfiles again. Otherwise, since
you now have access to your Termux programs again, you can edit the file
with your text editor and fix the problem. After that you can move the
file back to it's original location.
## Possible broken dotfiles
If you use bash (default) these dotfiles get loaded:
- `.profile`
- `.bash_profile`
- `.bashrc`
If you use zsh:
- `.profile`
- `.zshrc`
### If you used chsh and set a broken shell
If you used `chsh` to set your default shell to something that doesn't
work as a shell your environment will also be broken. In this case use
the Failsafe Session to remove `~/.termux/shell` and launch a new normal
session.
`rm -rf /data/data/com.termux/files/home/.termux/shell`
## If the problem is not with the dotfiles
If the problem isn't with your dotfiles, you may have a broken
`$PREFIX`. This could have happened in various ways. Maybe there was a
broken update, something crashed at the wrong time or you messed around
int `$PREFIX` yourself. In this case, the best option is to use the
nuclear option. Remove `$PREFIX` entirely.
`rm -rf /data/data/com.termux/files/usr`
After that you can restart your Termux App completely, which will
trigger a reinstallation of the default `$PREFIX` contents. You'll have
to reinstall all your programs, but your `$HOME` folder remains
untouched, so all your dotfiles are still there.

355
docs/en/Remote_Access.md Normal file
View File

@ -0,0 +1,355 @@
Termux is capable of accessing remote devices by using some common
tools. It is also possible to turn a device running Termux into remote
controlled server.
# FTP
**Warning**: plain FTP is deprecated and insecure anyway. Termux FTP
server supports only anonymous login, there no any authentication and
everyone on your network can access files on your device. Use SFTP
(OpenSSH) instead!
Termux FTP server is based on busybox and service is managed by
\[Termux-services\]. If you decided to use FTP server, install these
packages:
`pkg install busybox termux-services`
After installation you need to restart session or source this file:
`source $PREFIX/etc/profile.d/start-services.sh`
Now you ready to enable and start the FTP daemon service:
`sv-enable ftpd`
`sv up ftpd`
FTP server will run on port 8021 in read-only mode.
If you need to stop server, run `sv down ftpd`.
# SSH
SSH provides a secure way for accessing remote hosts and replaces tools
such as telnet, rlogin, rsh, ftp. Termux provides SSH via two packages:
**dropbear** and **openssh**. If you never used these tools before, it
is recommended to install 'openssh' as it is more common.
## Using the SSH client
You can obtain an SSH client by installing either \`openssh\` or
\`dropbear\`.
### Usage example
To login to a remote machine where the ssh daemon is running at the
standard port (22):
`ssh user@hostname_or_ip`
Same as above, but if the ssh daemon running on different port, e.g.
8022:
`ssh -p 8022 user@hostname_or_ip`
Using public key authentication with ssh running on the standard port
and a private key stored in the file \`id_rsa\`:
`ssh -i id_rsa user@hostname_or_ip`
Note, that if \`id_rsa\` will be stored in \`\~/.ssh\` directory, you
can omit specifying it in the command. But if you have multiple keys, it
is necessary to pick a specific key with \`-i {path_to_privkey}\`.
#### SSH Agent
**Important note**: this does not work for Dropbear.
If you wish to use an SSH agent to avoid entering passwords, the Termux
openssh package provides a wrapper script named \`ssha\` (note the \`a\`
at the end) for ssh, which:
- Starts the ssh agent if necessary (or connect to it if already
running).
- Runs the \`ssh-add\` if necessary.
- Runs the \`ssh\` with the provided arguments.
This means that the agent will prompt for a key password at first run,
but remember the authorization for subsequent runs.
## Using the SSH server
### OpenSSH
OpenSSH (also known as OpenBSD Secure Shell) is a suite of secure
networking utilities based on the Secure Shell (SSH) protocol, which
provides a secure channel over an unsecured network in a clientserver
architecture.
Default SSH port in Termux is 8022.
#### Starting and stopping OpenSSH server
Since Termux does not use initialization system, services are started
manually from command line.
To start OpenSSH server, you need to execute this command:
`sshd`
If you need to stop \`sshd\`, just kill it's process:
`pkill sshd`
SSH daemon does logging to Android system log, you can view it by
running `logcat -s 'sshd:*'`. You can do that either from Termux or ADB.
#### Setting up password authentication
Password authentication is enabled by default. This will allow you to
get started with it much easier. Before proceeding, make sure that you
understand that password authentication is less secure than a
pubkey-based one.
1\. Ensure that everything is up to date and package \`openssh\` is
installed:
`pkg upgrade`
`pkg install openssh`
2\. Password authentication is enabled by default in configuration file.
But you can still review it (\$PREFIX/etc/ssh/sshd_config), it should be
like this:
`PrintMotd yes`
`PasswordAuthentication yes`
`Subsystem sftp /data/data/com.termux/files/usr/libexec/sftp-server`
3\. Set new password. Execute command `passwd`. While program allows
minimal password length is 1 character, the recommended password length
is more than 8-10 characters. Passwords are not printed to console.
`$ passwd`
`New password:`
`Retype new password:`
`New password was successfully set.`
#### Setting up public key authentication
Public key authentication is the recommended way for logging in using
SSH. To use this type of authentication, you need to have a
public/private key pair. For successful login, the public key must exist
in the authorized keys list on remote machine while private key should
be kept safe on your local host.
In the following example it will be assumed that you want to establish
public key authentication between your PC (host) and your Android device
running Termux (remote). It also will be assumed that you running Linux
distribution on your PC.
1\. If you do not have keys, you can generate them. In this example we
will generate RSA key. On PC, execute this command:
`ssh-keygen -t rsa -b 2048 -f id_rsa`
The command shown above generates private RSA key with 2048 bit key
length and saves it to file \`id_rsa\`. In the same directory you can
find a file \`id_rsa.pub\` it is a public key.
**Important note**: 2048 bit is the minimal key length that is
considered safe. You can use higher values, but do not use higher than
4096 as remote server may not support big keys.
2\. Copy key to the remote machine (Termux). Password authentication has
to be enabled in order to install pubkey on remote machine. Now do:
`ssh-copy-id -p 8022 -i id_rsa IP_ADDRESS`
Do not forget to replace \`IP_ADDRESS\` with the actual LAN IP address
of your device. It can be determined by using command `ifconfig`.
- Alternative you can manually copy the content inside
"id_rsa.pub"(public key) which is already on PC and looks like
`ssh-rsa `<A LOT OF RANDOM STRINGS>` user@host` and paste to the
Termux file `$HOME/.ssh/authorized_keys`(remote machine) Remember to
connect through `ssh user@`<Phone_IP>` -p 8022` so you can copy the
content of public key using any text editor available on PC and paste
inside Termux
If everything was okay, you will see a message like this one:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh -p '8022' '192.168.1.4'"
and check to make sure that only the key(s) you wanted were added.
3\. From this point password authentication can be disabled. Edit file
\$PREFIX/etc/ssh/sshd_config and replace line beginning with
"PasswordAuthentication" by
`PasswordAuthentication no`
Then execute command `pkill sshd; sshd` in order to restart server with
updated configuration file.
### Dropbear
Dropbear is a software package written by Matt Johnston that provides a
Secure Shell-compatible server and client. It is designed as a
replacement for standard OpenSSH for environments with low memory and
processor resources, such as embedded systems.
**Important note**: Dropbear does not provide SFTP server.
#### Starting and stopping Dropbear server
Same as for OpenSSH, you will need to execute it's binary manually.
Also, unlike OpenSSH, Dropbear does not use a configuration file but
only command line arguments.
Server is running in background, both password and public key
authentication available. To achieve this, just type in console:
`dropbear`
If you need only public key authentication, do this instead:
`dropbear -s`
Also, server can be started in foreground. For this purpose use a
parameter \`-F\`:
`dropbear -F`
Server started in foreground can be stopped by just Ctrl-C key
combination. If it is in the background, then you can use a \`pkill\`:
`pkill dropbear`
#### Setting up password authentication
Same as for OpenSSH, password authentication is enabled by default.
Everything you have to do, is:
1\. Make sure that everything is up to date and dropbear is installed:
`pkg upgrade`
`pkg install dropbear`
2\. Set password by executing command `passwd`.
3\. Start dropbear server. You can execute either just `dropbear` to
start it in background or `dropbear -F` to start it in the foreground.
#### Setting up public key authentication
Same as for OpenSSH, you can put your keys by using `ssh-copy-id`. But
if you consider to setup a public key authentication from Termux to
something else, it is worth to mention some important differences
between OpenSSH and Dropbear.
1\. Dropbear uses a different command for generating keys. Example of
generating RSA key (2048 bit):
`dropbearkey -t rsa -f id_rsa -s 2048`
2\. Public key should be obtained manually. To do this, you have to use
'dropbearkey' again, but in different way:
`dropbearkey -f id_rsa -y`
3\. Dropbear and OpenSSH uses a different key formats. To use a
Dropbear's key in OpenSSH, you will have to convert it:
`dropbearconvert dropbear openssh ./id_rsa ./id_rsa_openssh`
This procedure can be done vice versa to obtain a key in Dropbear's
format:
`dropbearconvert openssh dropbear ./id_rsa_openssh ./id_rsa_dropbear`
## Using the SFTP
Package OpenSSH provides a tool for accessing remote hosts over SFTP.
This will allow you to work with files in same way as via FTP but with
better security.
First install openssh-sftp-server
`$ pkg install openssh-sftp-server`
Connecting to Termux (sshd listening on port 8022):
`$ sftp -P 8022 192.168.1.20`
Connecting to somewhere else (sshd listening on standard port):
`$ sftp sftp.example.com`
However, to use command line SFTP client you should know some basic
commands:
- **cd** PATH - change current directory to \`PATH\`.
- **get** REMOTE \[LOCAL\] - download file \`REMOTE\` and rename it as
\`LOCAL\` (optional).
- **mkdir** PATH - create directory \`PATH\`.
- **ls** \[PATH\] - list files in directory \`PATH\`. If no argument,
files in current directory will be listed.
- **put** LOCAL \[REMOTE\] - Upload file \`LOCAL\` and rename it as
\`REMOTE\` (optional).
- **rm** FILE - Delete file \`FILE\`.
This is not a complete list of SFTP commands. To view all available
commands, consider to view man page (`man sftp`) or view short help in
interactive SFTP session by issuing command \`help\`.
# MOSH
Mosh is a remote terminal application that allows roaming, supports
intermittent connectivity, and provides intelligent local echo and line
editing of user keystrokes.
### Usage example
**Important note**: Mosh should be installed on both client and server
side.
Connecting to remote host (sshd listening on standard port):
`mosh user@ssh.example.com`
Connecting to Termux (sshd listening on port 8022):
`mosh --ssh="ssh -p 8022" 192.168.1.25`
# Rsync
Rsync is a tool for synchronizing files with remote hosts or local
directories (or drives). For better experience of using rsync, make sure
that package \`openssh\` (or \`dropbear\`) is installed.
### Usage example
Sync your photos with PC:
`$ rsync -av /sdcard/DCIM/ user@192.168.1.20:~/Pictures/Android/`
Get photos from remote Android device:
`$ rsync -av -e 'ssh -p 8022' 192.168.1.3:/sdcard/DCIM/ /sdcard/DCIM/`
Sync local directories (e.g. from external sdcard to Termux home):
`$ rsync -av /storage/0123-4567/myfiles ~/files`
You may want to see man page (\`man rsync\`) to learn more about it's
usage.
# See Also
[Accessing Termux from the Internet](Bypassing_NAT)
[Connecting to Termux with SSH over
USB](https://glow.li/technology/2016/9/20/access-termux-via-usb/)

58
docs/en/Ruby.md Normal file
View File

@ -0,0 +1,58 @@
![](images/GemServer.png)
Ruby is a dynamic, open source programming language with a focus on
simplicity and productivity. It has an elegant syntax that is natural to
read and easy to write.
In Termux Ruby can be installed by executing
`pkg install ruby`
**Due to our infrastructure limits, we do not provide older versions of
packages. If you accidentally upgraded to unsuitable Ruby version and do
not have backups to rollback, do not complain! We recommend doing
backups of \$PREFIX for developers and other people who rely on specific
software versions.**
## Package management
After installing ruby, `gem` package manager will be available. Here is
a quick tutorial about its usage.
Installing a new gem:
`gem install {package_name}`</code>
Uninstalling gem:
`gem uninstall {package name}`
Listing installed gems:
`gem list --local`
Launching a local documentation and gem repository server:
`gem server`
When installing Ruby gems, it is highly recommended to have a package
`build-essential` to be installed - some gems compile native extensions
during their installation.
## Gem installation tips and tricks
*Tip: help us to collect more information about installing Ruby gems in
Termux. You can also help to keep this information up-to-date, because
current instructions may eventually become obsolete.*
| Package | Description | Dependencies | Special Instructions |
|---------------|-------------------------------------------------------------------------------------------------------------------|-----------------------------|------------------------------------------------|
| delayed_job | Database based asynchronous priority <https://github.com/collectiveidea/delayed_job> | | |
| ffi | A gem for loading dynamically-linked native libraries, binding functions within them <https://github.com/ffi/ffi> | | |
| jekyll | Tool for creating static websites <https://github.com/jekyll/jekyll> | ruby clang make libffi | |
| letter_opener | Preview mail in the browser instead of sending <https://github.com/ryanb/letter_opener> | | |
| lolcat | Prints rainbow colored text <https://github.com/busyloop/lolcat> | | |
| mina | Blazing fast application deployment tool <https://github.com/mina-deploy/mina> | | |
| nokogiri | XML and HTML library <https://github.com/sparklemotion/nokogiri> | libxslt libiconv pkg-config | gem install nokogiri -- --use-system-libraries |
| paperclip | Easy file attachment management for ActiveRecord <https://github.com/thoughtbot/paperclip> | | |
| thin | A very fast & simple Ruby web server <https://github.com/macournoyer/thin> | ruby make | gem install thin -- --use-system-libraries |

27
docs/en/Sharing_Data.md Normal file
View File

@ -0,0 +1,27 @@
Files stored in the home directory in Termux is not accessible to other
applications by default. This is a limitation of Android itself.
As a workaround, you can use `termux-open` available in termux-tools
package to share files with read access.
`$ termux-open -h`
`Usage: termux-open [options] path-or-url`
`Open a file or URL in an external app.`
`  --send               if the file should be shared for sending`
`  --view               if the file should be shared for viewing (default)`
`  --chooser            if an app chooser should always be shown`
`  --content-type type  specify the content type to use`
`$ termux-open hello.c`
For compatibility with standard Linux programs, `xdg-open` is symlinked
to `termux-open`.
Sometimes, read access is not enough, you need to be able to modify
files. This can be achieved by storing the required files on an sdcard.
Android Lollipop should work right out of the box, but, Marshmallow and
above require the Termux app to request permissions to Read/Write
External Data.
Run `termux-setup-storage` and grant permissions when the dialog pops
up. This will create a `$HOME/storage` directory with symlinks to
respective paths of sdcard(s).

82
docs/en/Shells.md Normal file
View File

@ -0,0 +1,82 @@
A shell is an command language interpreter that executes commands from
standard input devices (like a keyboard) or from a file. Shells are not
a part of the system kernel, but use the system kernel to execute
programs, create files, etc.
Use `chsh` from `termux-tools` to change your login shell. Currently
Termux supports bash, fish, tcsh, zsh and a few other shells.
# BASH
Homepage: <https://www.gnu.org/software/bash/>
Bash is the default shell after installing termux.
The BASH shell init files are `~/.bashrc`, `$PREFIX/etc/bash.bashrc` and
more. See \`man bash\` and \`info bash\` for more information.
# Beanshell
Homepage: <https://beanshell.github.io/>
Installation: `pkg install beanshell`
Beanshell is a fully Java compatible scripting language. BeanShell is
now capable of interpreting ordinary Java source and loading .java
source files from the class path. BeanShell scripted classes are fully
typed and appear to outside Java code and via reflective inspection as
ordinary classes. However their implementation is fully dynamic and they
may include arbitrary BeanShell scripts in their bodies, methods, and
constructors. Users may now freely mix loose, unstructured BeanShell
scripts, method closures, and full scripted classes.
# [FISH](FISH)
Homepage: <http://fishshell.com/>
Installation: `pkg install fish`
FISH is a smart and user-friendly command line shell for macOS, Linux,
and the rest of the family.
The FISH shell init files are `~/.fish`, `$PREFIX/etc/fish/config.fish`
and more. See \`man fish\` and \`info fish\` for more information.
[More information...](FISH)
# IPython
Homepage: <https://ipython.org/>
Installation: `pip install ipython`
IPython is an advanced interactive shell for Python language.
# TCSH
Homepage: <http://www.tcsh.org/>
Installation: `pkg install tcsh`
TCSH is a C shell with file name completion and command line editing.
The TCSH shell init files are `~/.tcshrc`, `$PREFIX/etc/csh.cshrc` and
more. See \`man tcsh\` and \`info tcsh\` for more information.
# Xonsh
Homepage: <http://xon.sh/>
Installation: `pip install xonsh`
Xonsh is a Python-powered, cross-platform, Unix-gazing shell language
and command prompt. The language is a superset of Python 3.4+ with
additional shell primitives that you are used to from Bash and IPython.
It works on all major systems including Linux, Mac OSX, and Windows.
Xonsh is meant for the daily use of experts and novices alike.
# [ZSH](ZSH)
Homepage: <https://www.zsh.org/>
Installation: `pkg install zsh`
Zsh is a shell designed for interactive use, although it is also a
powerful scripting language. Many of the useful features of bash, ksh,
and tcsh were incorporated into zsh.
The zsh shell init files are `~/.zshrc` and `$PREFIX/etc/zshrc` and
more. See `man zsh` and `info zsh` for more information.
[More information...](ZSH)

2
docs/en/Slackware.md Normal file
View File

@ -0,0 +1,2 @@
1. REDIRECT
[PRoot#Community_scripts](PRoot#Community_scripts)

13
docs/en/Software.md Normal file
View File

@ -0,0 +1,13 @@
Software that works in Termux on a smartphone and tablet in Android and
Chrome. Termux offers a wide range of software for your device.
- [Development Environments](Development_Environments): Termux is a great software development environment.
- [Differences from Linux](Differences_from_Linux): There are several differences between Termux and a regular Linux distribution.
- [Editors](Editors): Edit, write and manipulate text and data files.
- [Graphical Environment](Graphical_Environment): Everything about using X Window System in Termux.
- [Intents and Hooks](Intents_and_Hooks): Use intents and hooks to access Termux from other apps.
- [Package Management](Package_Management): Basic and advanced package and module management.
- [Package Tips](Package_Tips): A list of manuals for packages that are tricky to install.
- [Remote Access](Remote_Access): Access your remote devices or the Termux itself.
- [Sharing Data](Sharing_Data): Accessing files in the \$HOME directory in other apps on device
- [Shells](Shells): A listing of some of the available shells in Termux.

1
docs/en/Sound_Editors.md Normal file
View File

@ -0,0 +1 @@
1. REDIRECT [Audio Editors](Audio_Editors)

15
docs/en/Stream_Editors.md Normal file
View File

@ -0,0 +1,15 @@
A Unix utility that parses and transforms text, using a simple, compact
programming language. Options for doing "stream editing" include awk,
node.js, perl and sed.
## gawk
Programming language designed for text processing
Homepage: <https://www.gnu.org/software/gawk/>
## sed
GNU stream text editor
Homepage: <https://www.gnu.org/software/sed/>

View File

@ -0,0 +1,35 @@
In this page, it is written how to change the package manager in termux.
Termux currently has 2 package managers, `apt` (default) and `pacman`.
To switch to another package manager, you need to change bootstrap based
on the specific package manager.
#### Instruction:
First you need to install bootstrap based on a specific package manager.
- apt based bootstrap you can find
[here](https://github.com/termux/termux-packages/releases)
- pacman based bootstrap you can find
[here](https://github.com/termux-pacman/termux-packages/releases)
The second step is to create a `usr-n/` directory next to `usr/`, then
move the bootstrap archive to `usr-n/` and unzip it.
The third step is to run the following command in the `usr-n/` directory
to create symbolic links.
`cat SYMLINKS.txt | awk -F "←" '{system("ln -s '"'"'"$1"'"'"' '"'"'"$2"'"'"'")}'`
The fourth step is to replace `usr/` with `usr-n/`, to do this, run
failsafe (how to run it is written [here](Fail-safe)), then
delete the old `usr/` directory and rename `usr-n/`.
`cd ..`
`rm -fr usr/`
`mv usr-n/ usr/`
**If you are switching to pacman then you need to follow this step.**
The fifth step, exit failsafe and start termux normally, then run the
following command to set up gpg keys for pacman.
`pacman-key --init`
`pacman-key --populate`

67
docs/en/TeX_Live.md Normal file
View File

@ -0,0 +1,67 @@
Texlive can be installed through the package `texlive-installer`. The
package contains `termux-install-tl`, a wrapper around texlive's own
install-tl script.
Texlive for termux needs several patches to work with termux's non
standard filesystem. There is a risk that updates through tlmgr break
our texlive since they might undo the various applied patches. If
texlive breaks after an update you can run `termux-patch-texlive` to
(try to) apply the patches again.
When installing through termux-install-tl you cannot customize
everything, changing installation path or trying to use binaries from
upstream will break texlive.
# TeX Live Package Management
Texlive packages can be inatalled through texlive's package manager
tlmgr.
The most up-to-date version of tlmgr documentation (updated nightly from
the development sources) is available at
<http://tug.org/texlive/tlmgr.html>, along with procedures for updating
tlmgr itself and information about test versions. A Texlive installation
can be customized and managed at any level.
![](images/Texlive.png)
## tlmgr info
- `tlmgr search --global --file search.sty` will list available packages
containing the file `search.sty`.
- `tlmgr info collections` will list installed and available
collections. Collections usually means large downloading!
- `tlmgr info schemes` will list installed and available schemes.
Schemes means downloading even more and larger amazing tex goodies!
## tlmgr install
Single packages can be installed with
` tlmgr install `<package>
## tlmgr update
Updating all install texlive packages can be done
` tlmgr update --all`
# Details on how texlive-installer works
`texlive-installer` installs two scripts that can be run,
`termux-install-tl` and `termux-patch-texlive`.
`termux-install-tl` runs a patched variant (some paths needs to be
changed) of upstream's install-tl script with an argument
(`-custom-bin`) pointing to the binaries that have been installed with
`texlive-bin`. If you want to run the installer with other arguments,
for example `-repository` pointing to a local mirror, you can run
`termux-install-tl -repository path/to/mirror`. You are then shown a
text gui where you have the opportunity to choose which schemes you want
to install. After all texlive packages have been downloaded and
installed `termux-patch-texlive` is run to fix known problems, mostly to
change paths (`/tmp` -\> `$PREFIX/tmp` and similar).
If you at a later point run `tlmgr update` and end up with a
none-working texlive you might be able to fix the problems by running
`termux-patch-texlive`.

View File

@ -0,0 +1,145 @@
The Termux terminal can be configured by editing the
`~/.termux/termux.properties` file. This file uses a simple `key=value`
property syntax.
Lines beginning with `#` are comments and do not get executed. Most of
the properties are included as comments in the file. Uncomment an
existing line or add a new line to configure a property.
For changes to take effect after editing the properties file, either
execute `termux-reload-settings` or restart Termux by closing all
sessions and starting the application again.
# Dark theme
Force the application to use dark theme for drawer and dialogs with
``` ini
use-black-ui=true
```
*Note: This is enabled automatically on Android 9+ if the system UI uses
a dark theme.*
# Fullscreen mode
Enable fullscreen mode with
``` ini
fullscreen=true
```
It is likely that with fullscreen enabled, the Extra Keys view may no
longer be visible. To fix, add
``` ini
use-fullscreen-workaround=true
```
*Note: Fullscreen may not work well for all devices so consider it
unstable for now.*
# Handling terminal sessions
Use shortcut key combinations to handle common session actions. Add
shortcuts to open a new session, switch between sessions, and rename
sessions with
``` ini
# Open a new terminal with ctrl + t (volume down + t)
shortcut.create-session=ctrl + t
# Go one session down with (for example) ctrl + 2
shortcut.next-session=ctrl + 2
# Go one session up with (for example) ctrl + 1
shortcut.previous-session=ctrl + 1
# Rename a session with (for example) ctrl + n
shortcut.rename-session=ctrl + n
```
# Handling the bell character
Adjust the behavior of how the [bell
character](https://en.wikipedia.org/wiki/Bell_character) is received
with the `bell-character` property
``` ini
# Vibrate device (default).
bell-character=vibrate
# Beep with a sound.
bell-character=beep
# Ignore bell character.
bell-character=ignore
```
# Handling the back key
Adjust the behavior of how the back key is handled with the `back-key`
property
``` ini
# Send the Escape key.
back-key=escape
# Hide keyboard or leave app (default).
back-key=back
```
# Handling the extra keys
See [Touch Keyboard](Touch_Keyboard)
# Workaround issues with some keyboards
Some keyboards, e.g. a default one on Samsung devices, have issues with
text input: text appearing only after pressing "enter", wrong keyboard
layout being opened, etc. They are not compatible with the Termux input
method because enforcing a word-based input. As workaround, use
``` ini
enforce-char-based-input = true
```
This will tell Termux to use
`InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS`
instead of `InputType.TYPE_NULL`.
On some devices the combination of `ctrl + space` on hardware keyboards
does not work (for example in emacs) which makes it difficult to mark
text. As a workaround, use
``` ini
ctrl-space-workaround = true
```
*Note: setting this on devices where `ctrl + space` already works will
break the functionality.*
# Adjust Terminal Margin/Padding
Terminal horizontal margin (left and right) can be adjuted with
``` ini
terminal-margin-horizontal=val
```
And vertical margin (top and bottom) with
``` ini
terminal-margin-vertical=val
```
Where `val` is an integer (representing dp units) between `0` and `100`.
The default value is `3` for horizontal margin and `0` for vertical
margin.
This can be helpful for some setups, such as text on screen edges not
being fully visible due to curvature or a screen protector/case. A
larger horizontal margin may also be helpful for those having gesture
navigation enabled on Android 10+ due to not being able to touch at
exactly the edge of the screen.

View File

@ -0,0 +1,12 @@
Get the status of the device battery.
## Usage
This program does not take any arguments.
Output is returned in json format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,13 @@
Set the display brightness. Note that this may not work if automatic
brightness control is enabled.
## Usage
termux-brightness \[brightness\]
Brightness value should be between 0 and 255 or auto.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,17 @@
Print the phone call history.
## Usage
termux-call-log \[options\]
Output displayed in json format.
### Options
`-l limit   offset in call log list (default: 10)`
`-o offset  offset in call log list (default: 0)`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,12 @@
Get information about device camera(s).
## Usage
This program does not take any arguments.
Output is returned in json format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,16 @@
Take a photo and save it to a file in JPEG format.
## Usage
termux-camera-photo \[-c camera-id\] output-file
Photo is saved at specified file path.
### Options
`-c camera-id  ID of the camera to use (see termux-camera-info), default: 0`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,12 @@
Get the system clipboard text.
## Usage
This program does not take any arguments.
Output is returned in plain text.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,22 @@
Set the system clipboard text. The text to set is either supplied as
arguments or read from stdin if no arguments are given.
## Usage
termux-clipboard-set \[text\]
Text is read either from standard input or from command line arguments.
### Examples
`termux-clipboard-set "hello world"`
`cat file.txt | termux-clipboard-set`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.
[Termux-clipboard-get](Termux-clipboard-get) - Utility to
retrieve text from the clipboard.

View File

@ -0,0 +1,12 @@
List all contacts.
## Usage
This program does not take any arguments.
Output is returned in json format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

62
docs/en/Termux-dialog.md Normal file
View File

@ -0,0 +1,62 @@
Show dialog widget for user input.
## Usage
termux-dialog widget \[options\]
Output is returned in json format.
### Options
`-l, list   List all widgets and their options`
`-t, title  Set title of input dialog (optional)`
### Widget-specific options
confirm - Show confirmation dialog
[-i hint] text hint (optional)
[-t title] set title of dialog (optional)
checkbox - Select multiple values using checkboxes
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
counter - Pick a number in specified range
[-r min,max,start] comma delim of (3) numbers to use (optional)
[-t title] set title of dialog (optional)
date - Pick a date
[-t title] set title of dialog (optional)
[-d "dd-MM-yyyy k:m:s"] SimpleDateFormat Pattern for date widget output (optional)
radio - Pick a single value from radio buttons
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
sheet - Pick a value from sliding bottom sheet
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
spinner - Pick a single value from a dropdown spinner
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
speech - Obtain speech using device microphone
[-i hint] text hint (optional)
[-t title] set title of dialog (optional)
text - Input text (default if no widget specified)
[-i hint] text hint (optional)
[-m] multiple lines instead of single (optional)*
[-n] enter input as numbers (optional)*
[-p] enter input as password (optional)
[-t title] set title of dialog (optional)
* cannot use [-m] with [-n]
time - Pick a time value
[-t title] set title of dialog (optional)
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,20 @@
Download a resource using the DownloadManager API which shows a
notification with your download details including a progress bar.
## Usage
termux-download \[-d description\] \[-t title\] \[-p path\]
url-to-download
Does not return anything.
### Options
`-d description  description for the download request notification`
`-t title        title for the download request notification`
`-p path         path to save the downloaded file`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

16
docs/en/Termux-exec.md Normal file
View File

@ -0,0 +1,16 @@
Termux-exec allows you to execute scripts with shebangs for traditional
Unix file structures. So shebangs like `#!/bin/sh` and
`#!/usr/bin/env python` should be able to run without
[termux-fix-shebang](termux-fix-shebang).
After upgrading to apt version 1.4.8-1 or more recent, termux-exec
should be already installed as dependency of apt, if not — it is time to
run `pkg upgrade` and then restart Termux application.
If you are not able to run scripts with shebangs like `#!/bin/sh` even
if termux-exec is installed, try to reset LD_PRELOAD environment
variable:
`export LD_PRELOAD=${PREFIX}/lib/libtermux-exec.so`
and then restart Termux session.

View File

@ -0,0 +1,17 @@
Use fingerprint sensor on device to check for authentication.
## Usage
This program does not take any arguments.
Output is returned in json format.
## Note
This API is available only for devices running Android 6 (Marshmallow)
or higher.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,18 @@
**There is a newer and simpler solution, install
[termux-exec](termux-exec) to resolve this matter.**
Only files within Termuxs private space can be made executable. So any
executable files such as shell scripts need to be kept inside the apps
native space unless you run them through a shell, e.g. `sh script.sh`,
`bash script.sh`, `csh script.sh`, etc...
Since the usual location `/bin` is
`/data/data/com.termux/files/usr/bin`, also known as `$PREFIX/bin`, this
can cause problems with scripts which have a shebang such as
`#!/bin/sh`. This can be fixed by using `termux-fix-shebang` on the
shell scripts. For example:
`  termux-fix-shebang script.sh`
`  ./script.sh`
Now `script.sh` should run correctly.

View File

@ -0,0 +1,16 @@
Query the infrared transmitter's supported carrier frequencies.
## Usage
This program does not take any arguments.
Output is returned in json format.
## Note
This API can be used only on devices that have infrared transmitter.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,21 @@
Transmit an infrared pattern.
## Usage
termux-infrared-transmit -f frequency pattern
The pattern is specified in comma-separated on/off intervals, such as
'20,50,20,30'. Only patterns shorter than 2 seconds will be transmitted.
### Options
`-f frequency  IR carrier frequency in Hertz. Mandatory.`
## Note
This API can be used only on devices that have infrared transmitter.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

26
docs/en/Termux-keyring.md Normal file
View File

@ -0,0 +1,26 @@
The various official package repositories are maintained and signed by
the members of the [termux-team](https://github.com/orgs/termux/people).
Each member has there own GPG key that is used for signing and the
public component of these keys are available in the package
`termux-keyring`. Installing termux-keyring makes apt recognize and
trust these keys, which is necessary for updating, and downloading from,
the repositories.
## Current keys in termux-keyring
### Grimler's key
[Grimler's](https://github.com/Grimler91) key is available as the file
[grimler.gpg](https://github.com/termux/termux-packages/blob/master/packages/termux-keyring/grimler.gpg)
and has fingerprint
`2C7F 29AE 9789 1F64 19A9  E2CD B007 6E49 0B71 616B`
### Automatic build's key
When packages are built and uploaded automatically using CI/CD, the
repository is signed with the key
[termux-autobuilds.gpg](https://github.com/termux/termux-packages/blob/master/packages/termux-keyring/termux-autobuilds.gpg)
and has fingerprint
`CC72 CF8B A7DB FA01 8287  7D04 5A89 7D96 E57C F20C`

View File

@ -0,0 +1,32 @@
Get the device location.
## Usage
termux-location \[-p provider\] \[-r request\]
Output displayed in json format.
### Options
`-p provider  location provider [gps/network/passive] (default: gps)`
`-r request   kind of request to make [once/last/updates] (default: once)`
## Note
- GPS likely will not work in buildings as device must be exposed to
satellite signal.
<!-- -->
- GPS also requires that your device clock is set correctly. For the
answer to question why, learn how GPS works.
<!-- -->
- Do not expect immediate location result. Even network location request
may take some time.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,18 @@
Play specified file using Media Player API.
## Usage
termux-media-player \[command\] \[args\]
### Commands
`info        Displays current playback information`
`play        Resumes playback if paused`
`play `<file>` Plays specified media file`
`pause       Pauses playback`
`stop        Quits playback`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,17 @@
Scan the specified file(s) and add to the media content provider.
## Usage
termux-media-scan \[-v\] \[-r\] file \[file...\]
Output displayed in plain text (informational message).
### Options
`-r  scan directories recursively`
`-v  verbose mode`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,22 @@
Record using microphone on your device.
## Usage
termux-microphone-record \[args\]
### Options
`-d           Start recording w/ defaults`
`-f `<file>`    Start recording to specific file`
`-l `<limit>`   Start recording w/ specified limit (in seconds, unlimited for 0)`
`-e `<encoder>` Start recording w/ specified encoder (aac, amr_wb, amr_nb)`
`-b `<bitrate>` Start recording w/ specified bitrate (in kbps)`
`-r `<rate>`    Start recording w/ specified sampling rate (in Hz)`
`-c `<count>`   Start recording w/ specified channel count (1, 2, ...)`
`-i           Get info about current recording`
`-q           Quits recording`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,13 @@
Remove a notification previously shown with "termux-notification --id".
## Usage
termux-notification-remove \[id\]
Notification id is a value previously used to show notification with
command "termux-notification".
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,67 @@
Display a system notification. Content text is specified using
-c/--content or read from stdin.
## Usage
termux-notification \[options\]
### Options
` --action action          action to execute when pressing the notification`
` --alert-once             do not alert when the notification is edited`
` --button1 text           text to show on the first notification button`
` --button1-action action  action to execute on the first notification button`
` --button2 text           text to show on the second notification button`
` --button2-action action  action to execute on the second notification button`
` --button3 text           text to show on the third notification button`
` --button3-action action  action to execute on the third notification button`
` -c/--content content     content to show in the notification. Will take precedence over stdin.`
` --group group            notification group (notifications with the same group are shown together)`
` -h/--help                show this help`
` --help-actions           show the help for actions`
` -i/--id id               notification id (will overwrite any previous notification with the same id)`
` --image-path path        absolute path to an image which will be shown in the notification`
` --led-color rrggbb       color of the blinking led as RRGGBB (default: none)`
` --led-off milliseconds   number of milliseconds for the LED to be off while it's flashing (default: 800)`
` --led-on milliseconds    number of milliseconds for the LED to be on while it's flashing (default: 800)`
` --on-delete action       action to execute when the the notification is cleared`
` --ongoing                pin the notification`
` --priority prio          notification priority (high/low/max/min/default)`
` --sound                  play a sound with the notification`
` -t/--title title         notification title to show`
` --vibrate pattern        vibrate pattern, comma separated as in 500,1000,200`
` --type type              notification style to use (default/media)`
Media actions (available with --type "media"):
` --media-next             action to execute on the media-next button`
` --media-pause            action to execute on the media-pause button`
` --media-play             action to execute on the media-play button`
` --media-previous         action to execute on the media-previous button`
### Action arguments
Commands like --action, --on-delete, --button-1-action and --media-next
take an action string as their argument, which is fed to \`dash -c\`. A
few important things must be kept in mind when using actions:
You should use actions that do things outside of the terminal, like
--action "termux-toast hello". Anything that outputs to the terminal is
useless, so the output should either be redirected (--action "ls \>
\~/ls.txt") or shown to the user in a different way (--action
"ls\|termux-toast").
Running more than one command in a single action is as easy as --action
"command1; command2; command3" or --action "if \[ -e file \]; then
termux-toast yes; else termux-toast no; fi".
For anything more complex, you should put your script in a file, make it
executable, and use that as the action: --action \~/bin/script
The action is run in a different environment (not a subshell). Thus your
environment is lost (most notably \$PATH), and \~/.profile is not
sourced either. So if you need your \$PATH you should either:
- if the action is a script, set it explicitly in the script (e.g.
export PATH="\$HOME/bin:\$PATH")
- or use something like --action "bash -l -c 'command1; command2'").

27
docs/en/Termux-sensor.md Normal file
View File

@ -0,0 +1,27 @@
Get information about types of sensors as well as live data.
## Usage
termux-sensor \[options\]
Output displayed in json format.
### Options
`-h, help           Show this help`
`-a, all            Listen to all sensors (WARNING! may have battery impact)`
`-c, cleanup        Perform cleanup (release sensor resources)`
`-l, list           Show list of available sensors`
`-s, sensors [,,,]  Sensors to listen to (can contain just partial name)`
`-d, delay [ms]     Delay time in milliseconds before receiving new sensor update`
`-n, limit [num]    Number of times to read sensor(s) (default: continuous) (min: 1)`
## Note
Different devices have different sensors. Check the available sensors
for your device with command `termux-sensor -l`.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,83 @@
[termux-services](https://github.com/termux/termux-services) contains a
set of scripts for controlling services. Instead of putting commands in
\~/.bashrc or \~/.bash_profile, they can be started and stopped with
termux-services.
| Package | Daemon | Port | Description |
|--------------|--------------|------|--------------------------------------------------------------------------------------------------------------------------------|
| apache2 | httpd | 8080 | Apache Web Server [HTTP Web Server](https://en.wikipedia.org/wiki/Web_server) |
| at | atd | | AT and batch delayed command scheduling utility and daemon [at](https://en.wikipedia.org/wiki/At_(command)) |
| bitcoin | bitcoind | | Bitcoin Core |
| busybox | telnetd | 8023 | Remote terminal service [Telnet](https://en.wikipedia.org/wiki/Telnet) |
| busybox | ftpd | 8021 | FTP (File Transfer Protocol) [FTP](https://en.wikipedia.org/wiki/File_Transfer_Protocol) |
| cronie | crond | | Daemon that runs specified programs at scheduled times [cron](https://en.wikipedia.org/wiki/Cron) |
| emacs | emacsd | | Extensible, customizable text editor-and more [EMACS](https://www.emacswiki.org/emacs/EmacsAsDaemon) |
| ipfs | ipfs | | A peer-to-peer hypermedia distribution protocol [IPFS](https://en.wikipedia.org/wiki/InterPlanetary_File_System) |
| libmosquitto | mosquitto | 1883 | MQTT is a lightweight, publish-subscribe network protocol [MQTT](https://en.wikipedia.org/wiki/MQTT) |
| lighttpd | lighttpd | 8080 | Lighttpd Small webserver HTTP Web Server |
| | | | |
| lnd | lnd | | Lightning Network Daemon |
| mariadb | mysqld | 3306 | [MariaDB](https://en.wikipedia.org/wiki/MariaDB) Community-developed fork of the MySQL from its original authors |
| mpd | mpd | | [Music Player Daemon (MPD)](https://en.wikipedia.org/wiki/Music_Player_Daemon) |
| mpdscribble | mpdscribble | | MPD client which submits tracks being played |
| nginx | nginx | 8080 | NGINX Web server HTTP Web Server |
| openssh | sshd | 8022 | OpenSSH [SSH](https://en.wikipedia.org/wiki/Secure_Shell_Protocol) |
| postgresql | postgres | 5432 | PostgreSQL database [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) |
| privoxy | privoxy | | Privoxy is non-caching web proxy with advanced filtering capabilities [HTTP Proxy](https://en.wikipedia.org/wiki/Proxy_server) |
| tor | tor | | The Onion Router anonymizing overlay network [Tor](https://en.wikipedia.org/wiki/Tor_(network)) |
| transmission | transmission | | BitTorrent client [BitTorrent](https://en.wikipedia.org/wiki/BitTorrent) |
Supported services
To install termux-services, run
`pkg install termux-services`
and then restart termux so that the service-daemon is started.
To then enable and run a service, run
`sv-enable `<service>
If you only want to run it once, run
`sv up `<service>
To later stop a service, run:
`sv down `<service>
Or to disable it
`sv-disable `<service>
A service is disabled if \`\$PREFIX/var/service/<service>/down\` exists,
so the \`sv-enable\` and \`sv-disable\` scripts touches, or removes,
this file.
termux-services uses the programs from
[runit](http://smarden.org/runit/) to control the services. A bunch of
example scripts are available from the [same
site](http://smarden.org/runit/runscripts.html). If you find a script
you want to use, or if you write your own, you can use set it up by
running:
`mkdir -p $PREFIX/var/service/`<PKG>`/log`
`ln -sf $PREFIX/share/termux-services/svlogger $PREFIX/var/service/`<PKG>`/log/run`
and then put your run script for the package at
\$PREFIX/var/service/<PKG>/run and make sure that it is runnable.
You can then run
`sv up `<PKG>
to start it.
Log files for services are situated in \$PREFIX/var/log/sv/<PKG>/ with
the active log file named "current".
### Starting termux-services on boot
If you want your services to start on device boot, see the example in
[Termux:Boot](Termux:Boot)

View File

@ -0,0 +1,69 @@
In order to have access to shared storage (/sdcard or
/storage/emulated/0), Termux needs a storage access permission. It is
not granted by default and is not requested on application startup since
it is not necessary for normal application functioning.
**Storage access permission will not enable write access to the external
sdcard and drives connected over USB.**
## How To
Open Termux application and do following steps:
1. Execute command `termux-setup-storage`. If you already have executed
this command previously or for some reason already have `storage`
directory under \$HOME, utility will ask you to confirm wiping of
`~/storage`. This is safe as will only rebuild symlink set.
2. If permission request dialog was shown - grant permission.
3. Verify that you can access shared storage `ls ~/storage/shared`
Termux uses utility `termux-setup-storage` to configure access to the
shared storage and setup these symlinks for quick access to various
kinds of storages:
- The root of the shared storage between all apps.
`~/storage/shared`
- The standard directory for downloads from e.g. the system browser.
`~/storage/downloads`
- The traditional location for pictures and videos when mounting the
device as a camera.
`~/storage/dcim`
- Standard directory in which to place pictures that are available to
the user.
`~/storage/pictures`
- Standard directory in which to place any audio files that should be in
the regular list of music for the user.
`~/storage/music`
- Standard directory in which to place movies that are available to the
user.
`~/storage/movies`
- Symlink to a Termux-private folder on external storage (only if
external storage is available).
`~/storage/external-1`
### Android 11
You may get "Permission denied" error when trying to access shared
storage, even though the permission has been granted.
Workaround:
1. Go to Android Settings --\> Applications --\> Termux --\>
Permissions
2. Revoke Storage permission
3. Grant Storage permission again
This is a known issue, though this is not Termux bug.

22
docs/en/Termux-share.md Normal file
View File

@ -0,0 +1,22 @@
Share a specified file or text from standard input.
## Usage
termux-share \[options\] \[file\]
If file to share is not specified, program will read standard input.
### Options
`-a action        which action to performed on the shared content:`
`                 edit/send/view (default:view)`
`-c content-type  content-type to use (default: guessed from file extension,`
`                 text/plain for stdin)`
`-d               share to the default receiver if one is selected`
`                 instead of showing a chooser`
`-t title         title to use for shared content (default: shared file name)`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

View File

@ -0,0 +1,21 @@
List SMS messages.
## Usage
termux-sms-list \[options\]
Output displayed in json format.
### Options
`-d         show dates when messages were created`
`-l limit   offset in sms list (default: 10)`
`-n         show phone numbers`
`-o offset  offset in sms list (default: 0)`
`-t type    the type of messages to list (default: inbox):`
`           all|inbox|sent|draft|outbox`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,18 @@
Send a SMS message to the specified recipient number(s).
## Usage
` termux-sms-send -n number[,number2,number3,...] [-s slot] [text]`
The text to send is either supplied as arguments or read from stdin if
no arguments are given.
### Options
`-n number(s)  recipient number(s) - separate multiple numbers by commas`
`-s slot sim slot to use - silently fails if slot number is invalid or if missing READ_PHONE_STATE permission`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,13 @@
Request a file from the system and write it to the specified file.
## Usage
termux-storage-get \[output-file\]
Output file is mandatory argument. Also, make sure that specified path
is writable.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,12 @@
Call a telephony number.
## Usage
termux-telephony-call \[number\]
Requires a telephony number specified in appropriate format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,13 @@
Get information about all observed cell information from all radios on
the device including the primary and neighboring cells.
## Usage
This program does not take any arguments.
Output is returned in json format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,12 @@
Get information about the telephony device.
## Usage
This program does not take any arguments.
Output is returned in json format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

27
docs/en/Termux-toast.md Normal file
View File

@ -0,0 +1,27 @@
Show text in a Toast (a transient popup).
## Usage
termux-toast \[options\] \[text\]
The text to show is either supplied as arguments or read from stdin if
no arguments are given.
### Options
`-h  show this help`
`-b  set background color (default: gray)`
`-c  set text color (default: white)`
`-g  set position of toast: [top, middle, or bottom] (default: middle)`
`-s  only show the toast for a short while`
## Note
Color can be a standard name (i.e. red) or 6 / 8 digit hex value (i.e.
"#FF0000" or "#FFFF0000") where order is (AA)RRGGBB. Invalid color will
revert to default value.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

15
docs/en/Termux-torch.md Normal file
View File

@ -0,0 +1,15 @@
Toggle LED Torch on device.
## Usage
termux-torch \[on \| off\]
Program accepts a one of these values:
- on - enable torch.
- off - disable torch.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,14 @@
Get information about the available text-to-speech (TTS) engines. The
name of an engine may be given to the termux-tts-speak command using the
-e option.
## Usage
This program does not take any arguments.
Output is returned in json format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,44 @@
Speak text with a system text-to-speech (TTS) engine. The text to speak
is either supplied as arguments or read from stdin if no arguments are
given.
## Usage
termux-tts-speak \[-e engine\] \[-l language\] \[-n region\] \[-v
variant\] \[-p pitch\] \[-r rate\] \[-s stream\] \[text-to-speak\]
### Options
` -e engine    TTS engine to use (see termux-tts-engines)`
` -l language  language to speak in (may be unsupported by the engine)`
` -n region    region of language to speak in`
` -v variant   variant of the language to speak in`
` -p pitch     pitch to use in speech. 1.0 is the normal pitch,`
`                lower values lower the tone of the synthesized voice,`
`                greater values increase it.`
` -r rate      speech rate to use. 1.0 is the normal speech rate,`
`                lower values slow down the speech`
`                (0.5 is half the normal speech rate)`
`                while greater values accelerates it`
`                (2.0 is twice the normal speech rate).`
` -s stream    audio stream to use (default:NOTIFICATION), one of:`
`                ALARM, MUSIC, NOTIFICATION, RING, SYSTEM, VOICE_CALL`
## Tips & Tricks
### Termux-tts-speak is slow to start
It takes quite some time for it to actually play anything, but most of
that lost time comes due to startup time of the engine. You can keep the
engine running by using a fifo queue instead.
`   mkfifo ~/.tts`
`   while true; do cat ~/.tts; done | termux-tts-speak`
Then you can use it like this:
`   echo Today is > ~/.tts`
`   date > ~/.tts`
This will keep termux-tts-speak running and just play anything that's
send to `~/.tts`

82
docs/en/Termux-usb.md Normal file
View File

@ -0,0 +1,82 @@
List or access USB devices.
## Usage
termux-usb \[-l \| \[-r\] \[-e command\] device\]
### Options
`-l               list available devices`
`-r               show permission request dialog if not already granted`
`-e command       execute the specified command with a file descriptor`
`                 referring to the device as its argument`
### Details
Android doesn't allow direct access to usb devices, you need to request
a file descriptor for the device from the Java API instead. This means
that Linux usb software will need to be modified to work within Termux.
Here is a sample project to get started:
Make sure you have the Termux:API application installed. Set up the
necessary packages within Termux.
`pkg install termux-api libusb clang`
Enable OTG (host) mode and insert a usb device. Wait for it to be
recognised and verify it using the API:
`termux-usb -l`
Let's assume the device is /dev/bus/usb/001/002. Ask for permission to
access it:
`termux-usb -r /dev/bus/usb/001/002`
Try using it from libusb. Save this sample code as usbtest.c:
[(download)](https://gist.githubusercontent.com/bndeff/8c391bc3fd8d9f1dbd133ac6ead7f45e/raw/6d7174a129301eeb670fe808cd9d25ec261f7f9e/usbtest.c)
`#include <stdio.h>`
`#include <assert.h>`
`#include <libusb-1.0/libusb.h>`
`int main(int argc, char **argv) {`
`    libusb_context *context;`
`    libusb_device_handle *handle;`
`    libusb_device *device;`
`    struct libusb_device_descriptor desc;`
`    unsigned char buffer[256];`
`    int fd;`
`    assert((argc > 1) && (sscanf(argv[1], "%d", &fd) == 1));`
`    libusb_set_option(NULL, LIBUSB_OPTION_NO_DEVICE_DISCOVERY);`
`    assert(!libusb_init(&context));`
`    assert(!libusb_wrap_sys_device(context, (intptr_t) fd, &handle));`
`    device = libusb_get_device(handle);`
`    assert(!libusb_get_device_descriptor(device, &desc));`
`    printf("Vendor ID: %04x\n", desc.idVendor);`
`    printf("Product ID: %04x\n", desc.idProduct);`
`    assert(libusb_get_string_descriptor_ascii(handle, desc.iManufacturer, buffer, 256) >= 0);`
`    printf("Manufacturer: %s\n", buffer);`
`    assert(libusb_get_string_descriptor_ascii(handle, desc.iProduct, buffer, 256) >= 0);`
`    printf("Product: %s\n", buffer);`
`    if (libusb_get_string_descriptor_ascii(handle, desc.iSerialNumber, buffer, 256) >= 0)`
`        printf("Serial No: %s\n", buffer);`
`    libusb_exit(context);`
`}`
This utility shows some basic information about a usb device. It takes
the device file descriptor as its only command-line argument. Let's
compile it:
`gcc usbtest.c -lusb-1.0 -o usbtest`
Use the -e option of termux-usb to run ./usbtest with the correct file
descriptor:
`termux-usb -e ./usbtest /dev/bus/usb/001/002`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

15
docs/en/Termux-vibrate.md Normal file
View File

@ -0,0 +1,15 @@
Vibrate the device.
## Usage
termux-vibrate \[options\]
### Options
`-d duration  the duration to vibrate in ms (default:1000)`
`-f           force vibration even in silent mode`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

15
docs/en/Termux-volume.md Normal file
View File

@ -0,0 +1,15 @@
Change volume of specified audio stream.
## Usage
termux-volume \[stream\] \[volume\]
Valid audio streams are: alarm, music, notification, ring, system, call.
Call w/o arguments to show information about each audio stream (output
format is json).
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,12 @@
`termux-wake-lock` and `termux-wake-unlock` can be used to trigger a
wakelock which causes Android not to go into deep sleep.
![](images/ScreenshotTermux720170903.png)
Since the default login shell is bash; it could be useful to call
`termux-wake-lock` in your \~/.profile (or \~/.bash_profile where
appropriate) and `termux-wake-unlock` in your \~/.bash_logout; for
single session usage. For multiple sessions, you'll have to manage the
unlock call yourself. But it is an option to call bash once and use
`byobu` to get a multiple bash session running within a single termux
session.

View File

@ -0,0 +1,16 @@
Change wallpaper on your device.
## Usage
termux-wallpaper cmd \[options\]
### Options
`-f `<file>`  set wallpaper from file`
`-u `<url>`   set wallpaper from url resource`
`-l         set wallpaper for lockscreen (Nougat and later)`
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,13 @@
Print information about current Wi-Fi connection. This information
include: SSID (AP name), BSSID (AP mac address), device IP and other.
## Usage
This program does not take any arguments.
Output is returned in json format.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,15 @@
Toggles Wi-Fi on/off.
## Usage
termux-wifi-enable \[true \| false\]
Program accepts a one of these values:
- true - enable Wi-Fi
- false - disable Wi-Fi
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

View File

@ -0,0 +1,17 @@
Retrieves last wifi scan information.
## Usage
This program does not take any arguments.
Output is returned in json format.
## Note
This API does not perform scanning. Instead, it retrieves information
about last scan done by Android OS.
## See Also
[Termux:API](Termux:API) - Termux addon that exposes device
functionality as API to command line programs.

70
docs/en/Termux:API.md Normal file
View File

@ -0,0 +1,70 @@
This addon exposes device functionality as API to command line programs
in [Termux](https://github.com/termux/).
## Installation
Download the Termux:API add-on from
[F-Droid](https://f-droid.org/packages/com.termux.api/) or the Google
Play Store. It is required for the API implementations to function.
**Important: Do not mix installations of Termux and Addons between
Google Play and F-Droid.** They are presented at these portals for your
convenience. There are compatibility issues when mixing installations
from these Internet portals. This is because each download website uses
a specific key for keysigning Termux and [Addons](Addons).
### Installing termux-api package
To use Termux:API you also need to install the
[termux-api](https://github.com/termux/termux-api-package) package.
`pkg install termux-api`
### Settings
On Android 7 you may have to "protect" Termux:API by going into the
settings / protected apps menu otherwise calls to the API like
termux-battery-status will hang forever. See [issue
334](https://github.com/termux/termux-packages/issues/334#issuecomment-340581650).
## Current API implementations
[termux-battery-status](termux-battery-status):Get the status of the device battery.
[termux-brightness](termux-brightness):Set the screen brightness between 0 and 255.
[termux-call-log](termux-call-log):List call log history.
[termux-camera-info](termux-camera-info):Get information about device camera(s).
[termux-camera-photo](termux-camera-photo):Take a photo and save it to a file in JPEG format.
[termux-clipboard-get](termux-clipboard-get):Get the system clipboard text.
[termux-clipboard-set](termux-clipboard-set):Set the system clipboard text.
[termux-contact-list](termux-contact-list):List all contacts.
[termux-dialog](termux-dialog):Show a text entry dialog.
[termux-download](termux-download):Download a resource using the system download manager.
[termux-fingerprint](termux-fingerprint):Use fingerprint sensor on device to check for authentication.
[termux-infrared-frequencies](termux-infrared-frequencies):Query the infrared transmitter's supported carrier frequencies.
[termux-infrared-transmit](termux-infrared-transmit):Transmit an infrared pattern.
[termux-job-scheduler](termux-job-scheduler):Schedule a Termux script to run later, or periodically.
[termux-location](termux-location):Get the device location.
[termux-media-player](termux-media-player):Play media files.
[termux-media-scan](termux-media-scan):MediaScanner interface, make file changes visible to Android Gallery
[termux-microphone-record](termux-microphone-record):Recording using microphone on your device.
[termux-notification](termux-notification):Display a system notification.
[termux-notification-remove](termux-notification-remove):Remove a notification previously shown with termux-notification --id.
[termux-sensor](termux-sensor):Get information about types of sensors as well as live data.
[termux-share](termux-share):Share a file specified as argument or the text received on stdin.
[termux-sms-list](termux-sms-list):List SMS messages.
[termux-sms-send](termux-sms-send):Send a SMS message to the specified recipient number(s).
[termux-storage-get](termux-storage-get):Request a file from the system and output it to the specified file.
[termux-telephony-call](termux-telephony-call):Call a telephony number.
[termux-telephony-cellinfo](termux-telephony-cellinfo):Get information about all observed cell information from all radios on the device including the primary and neighboring cells.
[termux-telephony-deviceinfo](termux-telephony-deviceinfo):Get information about the telephony device.
[termux-toast](termux-toast):Show a transient popup notification.
[termux-torch](termux-torch):Toggle LED Torch on device.
[termux-tts-engines](termux-tts-engines):Get information about the available text-to-speech engines.
[termux-tts-speak](termux-tts-speak):Speak text with a system text-to-speech engine.
[termux-usb](termux-usb):List or access USB devices.
[termux-vibrate](termux-vibrate):Vibrate the device.
[termux-volume](termux-volume):Change volume of audio stream.
[termux-wallpaper](termux-wallpaper):Change wallpaper on your device.
[termux-wifi-connectioninfo](termux-wifi-connectioninfo):Get information about the current wifi connection.
[termux-wifi-enable](termux-wifi-enable):Toggle Wi-Fi On/Off.
[termux-wifi-scaninfo](termux-wifi-scaninfo):Get information about the last wifi scan.

43
docs/en/Termux:Boot.md Normal file
View File

@ -0,0 +1,43 @@
This addon will run scripts immediately after device was booted.
## Installation
Download add-on from
[F-Droid](https://f-droid.org/packages/com.termux.boot/)
**Important: Do not mix installations of Termux and Addons between
Google Play and F-Droid.** They are presented at these portals for your
convenience. There are compatibility issues when mixing installations
from these Internet portals. This is because each download website uses
a specific key for keysigning Termux and [Addons](Addons).
## Usage
1\. Install the Termux:Boot app.
2\. Go to Android settings and turn off battery optimizations for Termux
and Termux:Boot applications.
3\. Start the Termux:Boot app once by clicking on its launcher icon.
This allows the app to be run at boot.
4\. Create the \~/.termux/boot/ directory: Put scripts you want to
execute inside the \~/.termux/boot/ directory. If there are multiple
files, they will be executed in a sorted order.
5\. It is helpful to run termux-wake-lock as first thing to prevent the
device from sleeping.
Example: to start an sshd server and prevent the device from sleeping at
boot, create the following file at \~/.termux/boot/start-sshd:
`#!/data/data/com.termux/files/usr/bin/sh`
`termux-wake-lock`
`sshd`
If you want [Termux-services](Termux-services) to start
services on boot, you can use:
`#!/data/data/com.termux/files/usr/bin/sh`
`termux-wake-lock`
`. $PREFIX/etc/profile`

Some files were not shown because too many files have changed in this diff Show More