This repository is a fork of my dotfiles repository, specifically designed for Termux on Android.
Previously, both environments shared a single repository. I separated them because the two environments had different requirements, which resulted in conflicts and ambiguities.
Note: This repository is intended for ARM-based Android devices running Termux. If you want the regular x86_64 Arch Linux environment, see the dotfiles repository instead.
These dotfiles contain configurations for:
zshneovimyazitmuxXFCE
The setup uses:
- Termux as the Android host environment
- proot-distro
- Arch Linux ARM
- Termux:X11
- PulseAudio
- XFCE
The goal is to have a complete Arch Linux development environment running on Android while retaining access to Termux-specific functionality such as Termux:API, Termux:Widget, phone storage, and Termux:X11.
Install Termux from a supported source.
Do not mix Termux installations from different sources when using Termux plugins. Plugins such as Termux:X11, Termux:API and Termux:Widget need to be compatible with the installed Termux application.
Termux:X11 consists of two parts:
- The Android application
- The Termux companion package
Both are required.
Download and install the Termux:X11 Android APK from the official Termux:X11 releases.
The setup script installs the Termux-side companion package automatically.
Note: Termux:X11 requires Android 8 or newer.
See the official Termux:X11 documentation for additional information and troubleshooting.
Install the Termux:API Android plugin from the same compatible source as your Termux installation.
The Termux-side package is installed automatically by setup_termux.sh.
If you want to use Termux widgets, install the Termux:Widget Android plugin from the same compatible source as your Termux installation.
Run the following command from termux:
apt update && apt full-upgrade
Clone the repository into your Termux home directory:
cd ~
git clone https://github.com/phirrehan/dotfiles-termux.git
cd ~/dotfiles-termuxRun the Termux setup:
./.local/bin/setup_termux.shThe Termux setup is responsible for configuring the Android/Termux side of the environment and installing Arch Linux ARM.
Arch Linux is installed using:
proot-distro install danhunsaker/archlinuxarmThe setup script also copies the Arch setup script into Termux's shared temporary directory:
/tmp/setup_proot.sh
This allows the script to be accessed from inside the Arch proot environment.
Important: The Android Termux:X11 application must be installed manually before using the graphical desktop.
After setup_termux.sh completes, continue with the Arch Linux Setup.
The Arch environment is configured separately from Termux.
After setup_termux.sh has finished, enter Arch as root:
proot-distro login archlinux --shared-tmpThe --shared-tmp option is important because Termux:X11 uses a Unix socket located in Termux's temporary directory. Sharing /tmp makes that socket available inside the Arch environment.
You should now see a root shell similar to:
[root@localhost ~]#
The Termux setup has already copied setup_proot.sh into:
/tmp/setup_proot.sh
Copy it into the root user's home directory:
cp /tmp/setup_proot.sh /root/setup_proot.shMake it executable:
chmod +x /root/setup_proot.shThen run it:
/root/setup_proot.shAlternatively:
bash /root/setup_proot.shAfter setup_proot.sh has completed, exit the root Arch environment:
exitThen enter Arch using the newly-created user:
proot-distro login archlinux --user <username> --shared-tmpYou can now use Arch normally without logging in as root.
The Termux and Arch environments contain separate clones of this repository.
The Termux copy:
~/dotfiles-termux
The Arch copy:
/home/<username>/dotfiles-termux
These are independent Git repositories.
This is intentional.
Termux-specific configuration belongs to the Termux environment, while the normal shell, editor, terminal multiplexer, file manager, and desktop configuration is used inside Arch.
The automated setup performs this automatically.
Termux uses apt/pkg for package management.
Install nala, a clean wrapper for apt:
apt update
apt install nalaThe setup scripts use pkg rather than nala.
Some useful aliases are defined in:
~/dotfiles-termux/.config/zsh/aliases.zsh
Take a look at the aliases before using them.
The graphical environment uses:
Android
│
└── Termux
│
├── Termux:X11
│
├── PulseAudio
│
└── proot-distro
│
└── Arch Linux ARM
│
└── XFCE
Termux:X11 provides the X server on Android while XFCE runs inside Arch Linux.
PulseAudio runs on the Termux host.
It provides audio support for applications running inside the Arch environment.
The XFCE startup script starts PulseAudio before launching the graphical session.
Once the Arch setup is complete, XFCE can be started from Termux with:
./.local/bin/start_xfce.shIf .local/bin is in your $PATH, you can simply run:
start_xfce.shTo enter Arch without starting XFCE:
proot-distro login archlinux --user <username> --shared-tmpSet the display:
export DISPLAY=:0Then start XFCE:
dbus-run-session startxfce4PulseAudio should be running in the Termux host before starting applications that require audio.
These are most of the general configurations I use on my Android/Termux setup.
Hope you find them useful and have a good day!