This document provides a comprehensive overview of all scripts used in the FluxLinux project. Scripts are organized by category and include their purpose, execution context, and key functionality.
FluxLinux uses a layered script architecture:
graph TD
A[FluxLinux App] --> B[Termux Intent API]
B --> C[Termux Scripts]
B --> D[Common Scripts]
B --> E[Chroot Scripts]
C --> F[setup_termux.sh]
C --> G[termux_tweaks.sh]
D --> H[PRoot Distro]
H --> I[Component Scripts]
E --> J[Root Shell]
J --> K[Chroot Environment]
subgraph Termux Context
C
F
G
end
subgraph PRoot Context
D
H
I
end
subgraph Root Context
E
J
K
end
Location: app/src/main/assets/scripts/termux/
Scripts that run directly in Termux without root or container environments.
| Script | Purpose |
|---|---|
| install.sh | Native XFCE4 installation for Termux |
| install_apps.sh | Firefox and VS Code installation via tur-repo |
| setup_theme.sh | Nerd Fonts installation for Termux |
Location: app/src/main/assets/scripts/common/
Scripts that run inside PRoot-Distro containers (rootless). These can also be used in Chroot environments.
| Script | Purpose |
|---|---|
| setup_termux.sh | Core Termux initialization, installs proot-distro, X11, VirGL |
| setup_debian_family.sh | Generic post-install for Debian-based distros |
| flux_install.sh | PRoot distro installation orchestrator |
| termux_tweaks.sh | Oh My Zsh, themes, fonts, and fastfetch for Termux |
| Script | Purpose |
|---|---|
| start_gui.sh | Launch XFCE4 desktop via Termux:X11 (PRoot) |
| stop_gui.sh | Stop XFCE4 desktop and related services (PRoot) |
| Script | Purpose |
|---|---|
| setup_hw_accel_debian.sh | Turnip/VirGL GPU acceleration setup |
| setup_gpu.sh | GPU configuration helper |
| gpu_diagnostics.sh | GPU troubleshooting and diagnostics |
| Script | Purpose | Components Installed |
|---|---|---|
| setup_webdev_debian.sh | Web Development stack | Node.js, Python, VS Code, Firefox, Chromium, Antigravity |
| setup_appdev_debian.sh | App Development stack | Android SDK, Flutter, Kotlin, IntelliJ, Gradle |
| setup_cybersec_debian.sh | Cybersecurity tools | Nmap, Wireshark, Metasploit, John, Hydra, sqlmap |
| setup_office_debian.sh | Office productivity | LibreOffice, Thunderbird, Evince, Xournal++ |
| setup_emulation_debian.sh | Gaming & emulation | Box64, Wine (xow64), Heroic, RetroArch, DOSBox |
| setup_gamedev_debian.sh | Game development | Godot, Blender, GIMP, development tools |
| setup_gengdev_debian.sh | General development | Multiple programming languages and tools |
| setup_datascience_debian.sh | Data science | Python, Jupyter, pandas, matplotlib, etc. |
| setup_graphic_design_debian.sh | Graphic design | GIMP, Inkscape, Krita |
| setup_video_editing_debian.sh | Video editing | Kdenlive, Audacity, Blender |
| setup_customization_debian.sh | Desktop customization | Themes, icons, cursors, wallpapers, Zsh |
Location: app/src/main/assets/scripts/chroot/
Scripts that require root access for chroot-based container management.
| Script | Purpose |
|---|---|
| setup_debian13_chroot.sh | Debian 13 (Trixie) chroot installation |
| setup_debian_chroot.sh | Debian 12 chroot installation |
| setup_arch_chroot.sh | Arch Linux ARM64 chroot installation |
| Script | Purpose |
|---|---|
| stop_debian13_gui.sh | Stop Debian 13 chroot GUI session |
| Script | Purpose |
|---|---|
| uninstall_debian13.sh | Remove Debian 13 chroot environment |
| uninstall_debian_chroot.sh | Remove Debian 12 chroot environment |
flowchart TD
subgraph "Initial Setup"
A[setup_termux.sh] --> B[proot-distro install]
A --> C[Termux:X11]
A --> D[VirGL]
end
subgraph "Distro Installation"
B --> E[flux_install.sh]
E --> F[setup_debian_family.sh]
end
subgraph "GUI Launch"
F --> G[start_gui.sh]
G --> H[Termux:X11 App]
G --> I[PulseAudio]
G --> J[proot-distro login]
end
subgraph "Component Setup - Run inside distro"
J --> K[setup_hw_accel_debian.sh]
J --> L[setup_webdev_debian.sh]
J --> M[setup_appdev_debian.sh]
J --> N[setup_cybersec_debian.sh]
J --> O["Other component scripts..."]
end
subgraph "Chroot Path - Requires Root"
P[setup_debian13_chroot.sh] --> Q[Download rootfs]
Q --> R[Mount filesystems]
R --> S[Configure chroot]
S --> T[Generate launcher scripts]
end
| Context | Shell | User | Root Required | Environment |
|---|---|---|---|---|
| Termux | /data/data/com.termux/files/usr/bin/bash |
Termux user | No | Android bionic libc |
| PRoot | /bin/bash |
flux |
No | Linux glibc (emulated) |
| Chroot | /bin/bash or /bin/sh |
flux or root |
Yes | Linux glibc (native) |
| Root Shell | /bin/sh |
root |
Yes | Android + Magisk |
| Directory | Execution Context | Invoked Via |
|---|---|---|
scripts/termux/ |
Termux | Direct Termux execution |
scripts/common/ |
PRoot or Chroot | proot-distro login or chroot |
scripts/chroot/ |
Root Shell | su -c |
Purpose: Native XFCE4 installation for Termux (without PRoot/Chroot)
Execution Context: Termux
Key Operations:
- Update Termux packages
- Install XFCE4 desktop environment
- Install xfce4-terminal
- Install TigerVNC
Dependencies: None (initial script)
# Usage
bash ~/install.shPurpose: Install Firefox and VS Code (Code OSS) via Termux User Repository
Execution Context: Termux
Key Operations:
- Install
tur-repopackage - Install Firefox from TUR
- Install VS Code (Code OSS) from TUR
Dependencies: Termux with x11-repo
Purpose: Install Nerd Fonts for terminal icons
Execution Context: Termux
Key Operations:
- Install curl, ncurses-utils, zip
- Run termux-nf installer script
Purpose: Core Termux environment initialization
Execution Context: Termux
Marker File: $HOME/.fluxlinux/setup_termux.done
Key Operations:
- Clear package locks and repair dpkg
- Update all Termux packages
- Install core dependencies:
proot-distro- Rootless Linux containersx11-repo- X11/GUI supportpulseaudio- Audio servertermux-x11-nightly- X11 display server
- Install
tur-repoand hardware acceleration tools:virglrenderer-android- VirGL servermesa-zink- OpenGL over Vulkan
- Install Mali Vulkan wrapper (aarch64 only)
Callback Intent: fluxlinux://callback?result=success&name=setup_termux
Purpose: Generic post-installation for Debian-based distros
Execution Context: PRoot (inside distro)
Key Operations:
- Install XFCE4, goodies, dbus-x11, and TigerVNC
- Create user
fluxwith passwordflux - Configure sudo with NOPASSWD
- Set up VNC xstartup file
Purpose: PRoot distro installation orchestrator
Execution Context: Termux
Usage: bash flux_install.sh <distro_id> <base64_encoded_setup_script>
Key Operations:
- Check if distro already installed
- Run
proot-distro install <distro> - Decode and execute setup script inside distro
- Create marker file for tracking
- Send callback intent to app
Callback Intent: fluxlinux://callback?result=success&name=distro_install_<distro>
Purpose: Enhance Termux with Oh My Zsh, themes, and fonts
Execution Context: Termux
Key Operations:
- Install Oh My Zsh with plugins:
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-autocomplete
- Apply color schemes (GitHub Dark, Dracula, Gruvbox)
- Install Nerd Fonts (Meslo, FiraCode, JetBrainsMono)
- Configure fastfetch
- Set Zsh as default shell
Marker File: $HOME/.fluxlinux/termux_tweaks.done
Purpose: Launch XFCE4 desktop environment in PRoot
Execution Context: Termux
Usage: bash start_gui.sh [distro] (default: debian)
Key Operations:
- Kill existing X11 processes
- Start PulseAudio over TCP
- Start termux-x11 server on display :1
- Launch Termux:X11 Android app
- Login to PRoot distro with shared-tmp
- Start XFCE4 session as user
flux
Purpose: Stop XFCE4 desktop and related services
Execution Context: Termux
Usage: bash stop_gui.sh [distro] (default: debian)
Key Operations:
- Kill XFCE4 processes inside PRoot
- Stop Termux:X11 and Xwayland
- Stop PulseAudio
Purpose: Hardware acceleration setup (Turnip/VirGL)
Execution Context: PRoot or Chroot (as root)
Key Operations:
- Detect package manager (apt/pacman)
- Install Vulkan/Mesa dependencies
- GPU selection menu:
- Turnip (Adreno): Downloads Mesa Turnip drivers, configures Zink
- VirGL (Universal): Configures virpipe driver
- Create
gpu-launchwrapper script
Usage:
# After setup, use:
gpu-launch glmark2
gpu-launch glxinfo | grep 'OpenGL renderer'Environment Variables Set:
- Turnip:
MESA_LOADER_DRIVER_OVERRIDE=zink,VK_ICD_FILENAMES,TU_DEBUG=noconform - VirGL:
GALLIUM_DRIVER=virpipe,VTEST_SOCKET_NAME=/tmp/.virgl_test
Purpose: Web Development stack installation
Execution Context: PRoot or Chroot (as root)
Installed Components:
| Component | Version/Source |
|---|---|
| Firefox | Mozilla official repo |
| Chromium | Debian repos |
| Node.js | NodeSource v23 |
| Python 3 | Debian repos |
| VS Code | Official ARM64 tarball |
| Antigravity | Google APT repo |
Key Operations:
- Setup Mozilla Firefox repo with priority pinning
- Install Firefox and Chromium
- Setup NodeSource repo and install Node.js 23
- Install Python 3 with pip and venv
- Download and extract VS Code ARM64 tarball
- Create VS Code desktop entry with
--no-sandboxflag - Configure VS Code to disable extension signature verification
- Install Antigravity package with custom wrapper
Purpose: App Development stack (Android + Flutter + React Native)
Execution Context: PRoot or Chroot (as root)
Installed Components:
| Component | Version | Notes |
|---|---|---|
| OpenJDK | 21/17/default | Dynamic detection |
| Android SDK | SDK 34/35/36 | ARM64 native build-tools |
| Android NDK | r27d, r29 | ARM64 musl-based |
| Flutter | Stable | Git clone |
| Kotlin | 2.1.0 | Manual install |
| Gradle | 9.2.1 | Manual install |
| IntelliJ IDEA | 2025.3.1 | AArch64 build |
Key Operations:
- Install Java (JDK 21/17)
- Download and configure Android SDK cmdline-tools
- Install platform-tools and platforms (SDK 34/35/36)
- Wrap CMake/Ninja with system binaries
- Install ARM64 native NDK from HomuHomu833/android-ndk-custom
- Install ARM64 build-tools (aapt, aapt2, aidl, zipalign)
- Clone Flutter SDK
- Install Kotlin compiler
- Install Gradle 9.2.1
- Install IntelliJ IDEA Community
Environment Variables Set:
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-arm64
export ANDROID_HOME=/opt/android-sdk
export ANDROID_NDK=$ANDROID_HOME/ndk/29.0.14206865
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$PATH:/opt/flutter/bin
export PATH=$PATH:/opt/gradle/binPurpose: Cybersecurity and penetration testing tools
Execution Context: PRoot or Chroot (as root)
Installed Components:
| Category | Tools |
|---|---|
| Network Analysis | Nmap, Wireshark, tcpdump, netcat |
| Password Cracking | John the Ripper, Hydra, Hashcat |
| WiFi Security | Aircrack-ng |
| Web Security | SQLMap, Nikto |
| Exploitation | Metasploit Framework |
Key Operations:
- Enable non-free/contrib repositories
- Install network analysis tools
- Configure Wireshark for non-root users
- Install Metasploit via official installer
- Create Burp Suite wrapper (JAR method)
Purpose: Office productivity suite
Execution Context: PRoot or Chroot (as root)
Installed Components:
| Category | Application |
|---|---|
| Office Suite | LibreOffice (Writer, Calc, Impress) |
| Email Client | Thunderbird |
| PDF Viewer | Evince |
| PDF Annotation | Xournal++ |
| Fonts | Noto, Liberation, DejaVu |
Purpose: Gaming and Windows emulation
Execution Context: PRoot or Chroot (as root)
Installed Components:
| Component | Purpose |
|---|---|
| Box64 | x86_64 Linux binary emulation |
| xow64 | Wine integration for Windows apps |
| Heroic | Epic/GOG games launcher |
| RetroArch | Multi-system emulator |
| DOSBox | DOS emulator |
Key Operations:
- Install Box64 from Ryan Fortner's repo
- Download and patch xow64 for PRoot compatibility
- Install Heroic Games Launcher (ARM64 .deb)
- Install RetroArch and DOSBox
Usage:
# Run Windows executable
~/xow64 run <exe_file>Purpose: Desktop customization and theming
Execution Context: PRoot or Chroot (as root)
Key Operations:
- Download assets from GitHub release (
debian-v1) - Install themes (Space-light, Space-transparency)
- Install icons (Papirus, Papirus-Dark)
- Install cursors (Vimix variants)
- Set up wallpapers
- Install JetBrains Mono Nerd Font
- Generate XFCE4 configuration files:
xsettings.xml- Theme, icons, cursor, fonts, scalingxfwm4.xml- Window manager settingsxfce4-desktop.xml- Wallpaper configurationxfce4-keyboard-shortcuts.xml- Custom shortcutsxfce4-panel.xml- Panel layout
- Configure XFCE4 Terminal
- Install Oh My Zsh with agnosterzak theme
- Install pokemon-colorscripts
- Configure fastfetch
Purpose: Install and configure Debian 13 (Trixie) chroot environment
Execution Context: Root shell
Prerequisites: Root access, Magisk Busybox
Paths Used:
| Path | Purpose |
|---|---|
/data/local/tmp/chrootDebian13 |
Chroot root filesystem |
/data/local/tmp/start_debian13.sh |
GUI launcher script |
/data/local/tmp/start_debian13_gui.sh |
X11 + GUI wrapper |
/data/local/tmp/enter_debian13.sh |
CLI entry script |
/data/local/tmp/run_debian13_root.sh |
Root command runner |
/data/local/tmp/stop_debian13_gui.sh |
GUI stop script |
Key Operations:
- Detect root-capable Busybox (non-Termux paths)
- Download rootfs from GitHub release
- Extract rootfs with xz support
- Mount filesystems:
/dev,/sys,/proc,/dev/pts/dev/shm(tmpfs, 512M)/sdcard- Termux tmp (for X11 sockets)
- Configure network (DNS, hosts)
- Create Android permission groups (aid_inet, aid_net_raw, aid_graphics)
- Install packages (nano, vim, net-tools, sudo, git, dbus-x11)
- Create user
fluxwith groups - Install XFCE4
- Generate launcher scripts
Marker File: $DEBIANPATH/.flux_configured
Callback Intent: fluxlinux://callback?result=success&name=distro_install_debian13_chroot
Purpose: Install and configure Debian 12 chroot environment
Execution Context: Root shell
Similar to: setup_debian13_chroot.sh with following differences:
- Uses Debian 12 rootfs
- Different installation path:
/data/local/tmp/chrootDebian - Different rootfs URL
Purpose: Install Arch Linux ARM64 with KDE Plasma
Execution Context: Root shell
Key Differences from Debian:
- Downloads from archlinuxarm.org
- Uses pacman package manager
- Disables CheckSpace and sandbox in pacman.conf
- Dynamic mirror selection (tests 15+ mirrors)
- Installs KDE Plasma instead of XFCE4
- Initializes pacman keys
Generated Scripts:
/data/local/tmp/enter_arch.sh- CLI entry/data/local/tmp/start_arch_gui.sh- KDE Plasma launcher
Purpose: Stop Debian 13 chroot GUI session
Execution Context: Root shell
Key Operations:
- Detect Busybox
- Kill XFCE4 processes inside chroot
- Stop Termux:X11 and Xwayland
- Clean up X11 sockets
- Unmount all chroot filesystems
Purpose: Remove Debian 13 chroot environment
Execution Context: Root shell
Key Operations:
- Kill processes with root set to chroot path
- Dynamically unmount all mount points (deepest first)
- Force lazy unmount for stubborn mounts
- Remove rootfs directory
- Remove launcher scripts
Callback Intent: fluxlinux://callback?result=success&name=distro_uninstall_debian13_chroot
Purpose: Remove Debian 12 chroot environment
Execution Context: Root shell
Similar to: uninstall_debian13.sh with different paths
The chroot setup scripts generate additional scripts at runtime:
Location: /data/local/tmp/start_debian13.sh
Mounts filesystems and starts XFCE4 GUI.
Location: /data/local/tmp/start_debian13_gui.sh
Full GUI launcher that:
- Kills old processes
- Cleans X11 sockets
- Starts Termux:X11 app
- Mounts Termux tmp for socket sharing
- Starts XServer
- Checks PulseAudio and VirGL status
- Calls
start_debian13.sh
Location: /data/local/tmp/enter_debian13.sh
CLI-only entry to chroot (no GUI).
Location: /data/local/tmp/run_debian13_root.sh
Helper script to run commands as root inside chroot:
./run_debian13_root.sh "apt update"handle_error() {
echo "❌ FluxLinux Error: Script failed at step: $1"
read -p "Press Enter to acknowledge error and exit..."
exit 1
}progress() {
printf "\033[1;36m[+] %s\033[0m\n" "$1"
}
success() {
printf "\033[1;32m[✓] %s\033[0m\n" "$1"
}
error() {
printf "\033[1;31m[!] %s\033[0m\n" "$1"
}am start -a android.intent.action.VIEW \
-d "fluxlinux://callback?result=success&name=<script_name>"Used to prevent re-running setup:
MARKER_FILE="$HOME/.fluxlinux/setup_termux.done"
if [ -f "$MARKER_FILE" ]; then
echo "Already completed. Skipping."
exit 0
fi
# ... do work ...
touch "$MARKER_FILE"BB=""
CANDIDATES="/data/adb/magisk/busybox \
/data/adb/modules/busybox-ndk/system/bin/busybox \
/sbin/busybox \
/system/xbin/busybox \
/system/bin/busybox"
for path in $CANDIDATES; do
if [ -x "$path" ]; then
BB="$path"
break
fi
done