SkillAgentSearch skills...

Freshtermux

A easy pre-configured, user friendly Termux script for your Android device. Commands, instructions included in Wiki section

Install / Use

/learn @cyb0rgdoll/Freshtermux

README

freshtermux

termux

A pre-configured, user-friendly, easy termux shell for your android phone / tablet / device. Termux is a powerful Android app which is designed to install linux packages on your Android devices, programming languages such as Shell, Python, C, C++, Perl, Ruby, Java and many more useful packages. This script will help you get cranking at it with no errors from scripts, hassles or broken installations if you are new to termux.

System requirements:

  • Android 7.0 - 12.0
  • CPU: AArch64, ARM, i686, x86_64.
  • At least 300 MB of disk space.

--- Download Termux from fdroid ---

To install everything in this guide, download the file, type in terminal where your downloaded file is;

chmod +x newscript.sh
bash newscript.sh
or
bash newscript.sh

Features of this script included.

  • Homescreen
  • Common shortcut keys
  • Extended function buttons
  • Access external storage
  • Common tools to be installed
  • Custom extended function buttons
  • Themes; colours and fonts
  • Oh my Zsh setup [Plugins included]
  • Powerline included

Options and menus

A long press on the screen will display a selectable copy cursor, along with the Copy, Paste, More ... options.

Options screen

  • Click More ... to go to the next menu level.

More options

Long press on screen
 ├── COPY: Copy
 ├── PASTE: Paste
 ├── More: More
    ├── Select URL: Select URL
    └── Share transcipt: transfer all output of the current session (via Android api)
    └── Reset: Reset
    └── Kill process: Kill the current terminal session process
    └── Style: Style (requires Termux: Styling plugin)
    └── Keep screen on:
    └── Help: Help documentation (Termux Wiki)

Swipe right from the left edge of the screen to drag out the navigation bar, where you can create, switch, rename sessions, and bring up input methods.

Left multipanel

Common shortcut keys

When using the terminal, you need to use the Alt, Ctrl, Esc and other keys, but these keys are not available on the phone.

In Ter­mux, you can use the volume down button to simulate the Ctrl key. For example, volume + L is equivalent to pressing Ctrl + L on the keyboard.

The following are some of the shortcuts commonly used in the terminal, and they also work in Ter­mux.

 Ctrl + A-> cursor to start position
 Ctrl + E-> cursor to the end
 Ctrl + K-> Cut everything from here to the end
 Ctrl + U-> Cut everything from here to the beginning
 Ctrl + W-> Cut here to the left
 Ctrl + Y-> Paste words cut by Ctrl + U, Ctrl + D, Ctrl + W
 Ctrl + L-> equivalent to clear command, clear screen
 Ctrl + C-> terminate process / command
 Ctrl + D-> close terminal
 Ctrl + Z-> Suspend (send SIGTSTP to) the current process
 The volume plus button can be used as a special key to generate a specific input, which can be roughly understood as the Fn key on a laptop.

 Volume + E-> Esc
 Volume + T-> Tab
 Volume + 1-> F1 (Volume increase + 2 is equivalent to F2, and so on)
 Volume +0-> F10
 Volume + B-> Alt + B, return a word when using readline
 Volume + F-> Alt + F, forward a word when using readline
 Volume + X-> Alt + X
 Volume + W-> Up Arrow
 Volume + A-> Left Arrow
 Volume + S-> Down Arrow
 Volume + D-> Right Arrow
 Volume + L-> | (pipe character)
 Volume + H-> ~ (tilde character)
 Volume + U-> _ (underscore character)
 Volume + P-> Page Up (previous page)
 Volume + N-> Page Down (next page)
 Volume +.-> Ctrl + \ (SIGQUIT)
 Volume + V-> Show volume control
 Volume + Q-> Show extra button view
 Volume + K-> Ibid

Extended function buttons

As mentioned earlier, Ter­mux can use the volume keys to implement shortcut keys. Personally, using volume keys is not very inconvenient. Ter­mux also provides buttons for screen extensions. You can use volume plus + Q or volume plus + K to show and hide. controls less In addition, the function keys can be moved to the left to call up the text input box, which can more conveniently paste and modify the instructions to be entered more finely. controls sampled up

Package management

In addition to supporting the apt command, Ter­mux also encapsulates the pkg command. The pkg command is backward compatible with the apt command. The official recommendation is to use the pkg command, because it will automatically update the apt list when installing or upgrading the package, which means that performing pkg upgrade is equivalent to performing apt update && apt upgrade, which simplifies the operation process.

Simple default commands

 pkg search >> search a package
 pkg install >> installation of a package, shorthand pkg i
 pkg uninstall >> uninstall a package
 pkg reinstall >> reinstall a package
 pkg update / pkg upgrade >> to upgrade package, shorthand pkg up
 pkg list-all >> lists all packages available for installation(update)
 pkg list-installed >> lists installed packages
 pkg files >> show the path to the relevant folder of a package
 pkg clean >> remove unused packages

Differences between Termux and the standard Linux directory structure

Unlike most Linux distributions, Ter­mux does not follow file system hierarchy standards, and you cannot find directories such as / bin, / etc, / usr, / tmp and so on in standard paths. For convenience, Termux provides a special environment variable: PREFIX, which is equivalent to the / usr directory.

$ tree -d -L 1 $PREFIX
/data/data/com.termux/files/usr
├── bin
├── etc
├── include
├── lib
├── libexec
├── share
├── src
├── tmp
└── var
  • In addition, the user home directory is also in an unconventional location.
$ echo $HOME
/data/data/com.termux/files/home
  • Without root privileges, it is impossible to manipulate the root directory.
$ ls /
ls: cannot open directory '/': Permission denied
  • You can install proot for this and use the termux-chroot command to simulate the root environment and the standard Linux directory structure.
$ pkg i -y proot
$ termux-chroot
$ ls /
bin  data  dev  etc  home  lib  proc  root  sbin  share  storage  system  tmp  usr  var  vendor
$ ls /usr
bin  etc  include  lib  libexec  share  src  tmp  var

This can be useful for some programs that must use a standard path.

Root Authority

The solution is to install tsu for root privileges, tsu is an alternative to su in Ter­mux.

Install tsu:

 pkg i -y tsu

Execute the command with root privileges:

 tsudo command

Switch to root user:

 tsu

Under the root user, enter the exit command or press Ctrl + D to return to the normal user.

Access external storage

Ter­mux can only access its own internal data by default. If you want to access other data in the phone, after entering the following command, the phone will pop up a window for requesting permissions and allow it.

termux-setup-storage
  • This will create the $ HOME / storage directory, and subdirectories in this directory will be symbolically linked to some common directories in phone storage.
$ tree storage
storage
├── dcim -> /storage/emulated/0/DCIM
├── downloads -> /storage/emulated/0/Download
├── movies -> /storage/emulated/0/Movies
├── music -> /storage/emulated/0/Music
├── pictures -> /storage/emulated/0/Pictures
└── shared -> /storage/emulated/0
  • You can also access the root directory of external storage through / sdcard.

Custom extended function buttons

The default function buttons are too simple and do not have the left and right arrow keys, which is not convenient to use. Fortunately you can ~/.termux/termux.properties customize the key configuration file.

upgraded panel

  • If you want to set it up like this, you can add the following to the configuration file:
extra-keys = [['ESC','/','-','HOME','UP','END','PGUP','DEL'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN','BKSP']]

Easy mode code below, I usually do it with one click on keyboard:

mkdir -p ~/.termux && echo "extra-keys = [['ESC','/','-','HOME','UP','END','PGUP','DEL'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN','BKSP']]" > ~/.termux/termux.properties
  • Finally, enter the following command to reload the configuration, or close the application and then open it again.
termux-reload-settings

Install common tools

Install some basic common tools to facilitate subsequent tossing.

pkg i -y git curl wget tree vim nano tmux htop

Install and configure Oh My Zsh

  • Oh My Zsh will not make you a 10x developer ... but you may feel like one.

  • The above sentence comes from Oh My Zsh README, - - -

  • Plugins such as automatic suggestion, completion, and code highlighting functions will be installed which will tremousdly improve input effectincy for your terminal and make it user friendly for beginners.

  • On the first run, Powerlevel10k configuration wizard will ask you a few questions and configure your prompt. If it doesn't trigger automatically, type p10k configure. Configuration wizard creates ~/.p10k.zsh based on your preferences. Additional prompt customization can be done by editing this file. It has plenty of comments to help you navigate through configuration options.

Install zsh

pkg i -y zsh
  • Install Oh My Zsh
  • Download and install using curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  • Download and install using wget
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Oh My Zsh will prompt you to set zsh as the default sehll after installation. If not prompted, enter the follo

View on GitHub
GitHub Stars47
CategoryDevelopment
Updated1d ago
Forks10

Languages

Shell

Security Score

80/100

Audited on Apr 4, 2026

No findings