/r/termux

Photograph via snooOG

Official Reddit community of Termux project. Share your Termux configuration, custom utilities and usage experience or help others troubleshoot issues.

For everything related to the Termux android app —an open-source terminal emulator and Linux environment for Android.

/r/termux

53,232 Subscribers

3

Is this program to be blamed for Termux not working in recent Android 15 update?

1 Comment
2024/11/10
20:47 UTC

1

Battery Monitor, Network Monitor not working in Proot Debian

Is there a way to get the battery and network, etc monitors, working in proot? I think I've seen it in some of you guy's screenshots, but I can't seem to figure it out...

any suggestions how to enable?

2 Comments
2024/11/10
18:48 UTC

0

Screen recorder in termux

Is there any software that can record the screen in Termux?

9 Comments
2024/11/10
12:16 UTC

1

please help, Zenity termux is no longer working in the latest update 4.0.3. when I want to run Zenity --password, an error like this appears

../src/src/gallium/drivers/virgl/virgl_context.c:368: struct pipe_surface *virgl_create_surface(struct pipe_context *, struct pipe_resource *, const struct pipe_surface *): assertion "ctx->screen->get_param(ctx->screen, PIPE_CAP_DEST_SURFACE_SRGB_CONTROL) || (util_format_is_srgb(templ->format) == util_format_is_srgb(resource->format))" failed Aborted

1 Comment
2024/11/10
12:16 UTC

8

Would running `termux-packages` on an unrooted device, in a `debian` `proot` chroot with `udocker` be successful?

Prior to actually giving it a go, I am prospecting information as to whether it would be possible to run the termux-packages packages build script, which requires root privileges and leverages docker, on an unrooted device, in a Termux GNU/Linux proot chroot such as Debian GNU/Linux, with the Python script udocker? For project please refer:

https://github.com/indigo-dc/udocker

Any assistance greatly appreciated.

8 Comments
2024/11/10
03:03 UTC

2

Downloading playlist script.

Just wondering if anyone has ideas for this script. It simply downloads my yt playlist, extracts the audio as mp3, and zips the files. There's also some error logging and notifications.

#!/bin/bash

Variables

BASE_DIR="/data/data/com.termux/files/home/storage/music/termux" PLAYLIST_DIR="Beat_That" ZIPFILE="Beat_That.zip" LOGFILE="download.log" FAILED_LOG="failed.log" ERROR_SUMMARY="error_summary.log" VERBOSE=true FULL_PLAYLIST_DIR="$BASE_DIR/$PLAYLIST_DIR" YOUTUBE_PLAYLIST_URL="https://music.youtube.com/playlist?list=PLPHx1a3AKEWnVvtndzIUBtMfeiM6WCXds&si=Z8BCrEV8yrt4IlLx"

Function to log messages

log() { if $VERBOSE; then echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a $LOGFILE else echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> $LOGFILE fi termux-notification --title "Log Entry" --content "$1" }

Function to log failed files

log_failed() { echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a $FAILED_LOG termux-notification --title "Failed Log Entry" --content "$1" }

Function to handle errors

handle_error() { log_failed "$1" log "Error encountered: $1" termux-notification --title "Error" --content "An error occurred: $1" exit 1 }

Function to check if dependencies are installed

check_dependencies() { log "Updating and upgrading packages" pkg update && pkg upgrade -y log "Checking for required packages" for pkg in yt-dlp zip xargs; do if ! command -v $pkg &> /dev/null; then log "$pkg is not installed. Installing..." termux-notification --title "Installing Package" --content "Installing $pkg" pkg install $pkg -y || handle_error "Failed to install $pkg" else log "$pkg is already installed." fi done }

Function to clean up old logs and temporary files

cleanup() { log "Cleaning up old logs and temporary files" find . -name ".log" -type f -mtime +30 -exec rm {} ; find . -name ".mp3" -type f -exec rm {} ; }

Function to download audio

download_audio() { log "Starting audio download" yt-dlp -x --audio-format mp3 -N 4 -o "$FULL_PLAYLIST_DIR/%(title)s.%(ext)s" "$YOUTUBE_PLAYLIST_URL"
--exec "termux-notification --id 100 --title 'Downloading' --content 'Downloading: %(title)s'" log "Audio download completed" }

Main script execution

termux-notification --title "Script Started" --content "The download script has started." check_dependencies download_audio if [ -f "$ZIPFILE" ]; then log "ZIP file $ZIPFILE already exists. Removing it." rm "$ZIPFILE" fi if ls "$FULL_PLAYLIST_DIR"/.mp3 1> /dev/null 2>&1; then zip -r "$ZIPFILE" "$FULL_PLAYLIST_DIR"/.mp3 || handle_error "Failed to create ZIP file" rm "$FULL_PLAYLIST_DIR"/*.mp3 log "Zipped all MP3 files in $FULL_PLAYLIST_DIR into $ZIPFILE" termux-notification --title "Zipping Complete" --content "Zipped all MP3 files in $FULL_PLAYLIST_DIR into $ZIPFILE" else handle_error "No MP3 files found to zip" fi mv "$ZIPFILE" "$FULL_PLAYLIST_DIR/$ZIPFILE" || handle_error "Failed to move ZIP file to $FULL_PLAYLIST_DIR" if [ -s "$ERROR_SUMMARY" ]; then termux-notification --title "Errors Encountered" --content "Check $ERROR_SUMMARY for details." fi cleanup

Final notification with buttons

termux-notification --title "Script Completed" --content "The script has completed successfully."
--button1 "Run Again" --button1-action "bash /data/data/com.termux/files/home/scripts/notification_buttons/playlist_rerun"
--button2 "Delete ZIP" --button2-action "bash /data/data/com.termux/files/home/scripts/notification_buttons/delete_zip"
--button3 "Exit Termux" --button3-action "bash /data/data/com.termux/files/home/scripts/notification_buttons/exit"

1 Comment
2024/11/10
02:08 UTC

4

Unable to find libc.so when using proot?

I've got termux-x11 and bspwm installed with pkg but running into a problem.

I can run:

termux-x11 :0 -xstartup "dbus-launch --exit-with-session bspwm"

from outside of the distro with no problems.

But after I login:

proot-distro login ubuntu --shared-tmp

I get this error:

termux-x11 :0 -xstartup "dbus-launch --exit-with-session bspwm"
sh: error while loading shared libraries: libc.so: cannot open shared object file: No such file or directory

I also tried with Ubuntu and opensuse/tumbleweed and got the same result. I've gone over other guides and I don't seem to be missing a step.

The library exists:

find / -name "libc.so*" 2>/dev/null

/usr/lib/aarch64-linux-gnu/libc.so.6
/system/lib/libc.so
/system/lib64/libc.so

but isn't found:

ldd $(which bspwm)                                       libxcb.so => /data/data/com.termux/files/usr/lib/libxcb.so (0x0000007f7d1b8000)
        libxcb-util.so => /data/data/com.termux/files/usr/lib/libxcb-util.so (0x0000007f7d1b2000)
        libxcb-keysyms.so => /data/data/com.termux/files/usr/lib/libxcb-keysyms.so (0x0000007f7d1ae000)
        libxcb-icccm.so => /data/data/com.termux/files/usr/lib/libxcb-icccm.so (0x0000007f7d1a8000)
        libxcb-ewmh.so => /data/data/com.termux/files/usr/lib/libxcb-ewmh.so (0x0000007f7d19b000)
        libxcb-randr.so => /data/data/com.termux/files/usr/lib/libxcb-randr.so (0x0000007f7d189000)
        libxcb-xinerama.so => /data/data/com.termux/files/usr/lib/libxcb-xinerama.so (0x0000007f7d184000)
        libxcb-shape.so => /data/data/com.termux/files/usr/lib/libxcb-shape.so (0x0000007f7d17e000)
        libc.so => not found
        libXau.so => /data/data/com.termux/files/usr/lib/libXau.so (0x0000007f7d177000)
        libXdmcp.so => /data/data/com.termux/files/usr/lib/libXdmcp.so (0x0000007f7d16e000)
        libc.so => not found
        libc.so => not found
        libc.so => not found
        libc.so => not found
        libc.so => not found
        libc.so => not found
        libc.so => not found
        libc.so => not found
        libc.so => not found
        libc.so => not found

I'm on a Pixel 4a if that matters.

thanks

7 Comments
2024/11/09
23:15 UTC

1

How do I Setup Linux DE/WM on An Android Tablet

I'm getting a Xiaoxin Pad 2025 with a Dimensity 8300 chip. I have some linux experience and I want to do some basic web development (node) using neovim.

Can anyone refer a guide that would meet my needs? Also, do I need to root my device?

3 Comments
2024/11/09
18:24 UTC

0

Termux-x11 intercepts physical media keys

Did anyone have this problem ?

My media keys are working fine in android ... but if i open termux-x11 the media keys don't work anymore . The volume keys work however .

1 Comment
2024/11/09
17:26 UTC

9

RE: Open Termux drawer with keyboard shortcut

I just wanted to highlight this because I can't believe it took me so long to realise or find it...

Ctrl+Alt+<rightarrow> to open the drawer, Ctrl+Alt+<leftarrow> to close it again

so, for anyone else like me that uses Scrcpy (or other) to scale-up the display and mirror and control their android phone from their laptop, this is super helpful (and kinda obvious) 🤦‍♂️

2 Comments
2024/11/09
14:43 UTC

6

How to access Termux x11 using your pc

hey everyone i just have installed xfce4 desktop in my termux

my question is how can i access my xfce4 desktop in my windows pc is there any way to do that?

18 Comments
2024/11/08
14:23 UTC

7

Diffrence between native desktop and proot desktops

hey everyone i just have installed termux from the f-droid website and added some packages to help me customize it with the help of MasterDroid youtube videos

then i want to know if it's possible to install a gui (desktop environment) and i found also masterdroid video about that but i found there is 3 options native, proot, chroot

the last 2 options let me install a full linux environment with root or without it

but the 1st one can't understand it did i need to install a linux distro? or just install xfce4 desktop environment only? and when i use the terminal there did it uses termux terminal

i want to know if it's what i'm thinking or no (sorry for bad english explanation)

15 Comments
2024/11/08
09:18 UTC

5

How can I access the files generated in Termux? (solved)

This is the first time I've posted something on Reddit, I hope it doesn't violate any conventions. The files created in Termux cannot initially be found via file browser from outside Termux because they are in a sandbox. ChatGPT 4-O helped me solve the problem. It suggested 3 solutions and I successfully used solution 2. The others will probably work too:

If the output.txt file was created in Termux but isn’t visible outside the Termux environment, it might be due to Termux’s default sandbox, which restricts other apps from accessing Termux files. Here are some methods to make the file accessible outside of Termux:

Method 1: Move to a Shared Storage Folder

You can move the file to a shared folder accessible by other apps:

  1. Copy the file to shared storage:

cp ~/output.txt /storage/emulated/0/

This will save output.txt in your device’s main storage directory, where it should now be visible in the file manager.

  1. Check in File Manager:

Open your file manager (e.g., FX Explorer) and navigate to Internal Storage. You should see output.txt there.

Method 2: Set Up Access to the Default Termux Directory

If you want to regularly make files available to other apps, you can set up a shared folder in Termux.

  1. Create a shared folder in Termux:

termux-setup-storage

This command creates a storage folder in your Termux home directory (~/storage), which links to your device’s internal storage.

Inside, you’ll find directories like ~/storage/shared, which corresponds to your device’s main internal storage.

  1. Save files in this shared folder:

Copy the file to this shared storage location:

cp ~/output.txt ~/storage/shared/

The file should now be visible in the Internal Storage or Downloads folder.

Method 3: Use Cloud Storage (e.g., Google Drive)

If you want to sync the file across devices easily, you can use a cloud storage service like Google Drive. Tools like rclone in Termux allow you to copy files to cloud services.

With these methods, you should be able to access output.txt outside of Termux.

Addion:

ln -s /storage/emulated/0/Termux ~/termux_folder

This will create a symbolic link called termux_folder in your home directory that points to the /storage/emulated/0/Termux folder.

You can then access ~/termux_folder in Termux, which will take you directly to your "Termux" folder in main storage.

Using the new link: The symbolic link now allows you to write or read files in Termux to this custom folder without having to change the default directories. For example:

echo "Hello, Termux!" > ~/termux_folder/test.txt

This method allows you to save and retrieve Termux files in a folder you create in main memory.

5 Comments
2024/11/06
20:28 UTC

1

Is there any way to write/record Blu-ray discs using external BD drives (also via Termux-like apps)?

4 Comments
2024/11/06
17:22 UTC

2

Older Python

I searched on Google for Python 3.8, I found one build on Github but this replace the installed Python 3.12.
How can I get Python 3.8 or an older release of Python 3 on Termux ?

3 Comments
2024/11/06
11:12 UTC

2

Clang not found

I tried compiling termux clang using the build-package.shscript from Termux-packages in Docker, but it's failing. Am I missing something?

https://preview.redd.it/4qd676kj79zd1.png?width=1088&format=png&auto=webp&s=440f364e1718fb6367515d40d5f347bea44ab6f8

3 Comments
2024/11/06
09:55 UTC

1

Ubuntu KDA crashes on Samsung Galaxy Tab S7

Its running for like 4 5 minutes and when it crashes. Battery optimization is off at termux what else can i do to stop this? I cant found any reason for the crashes it happens randomly

I use the commands

ls start-androkde.sh ./start-androkde.sh vncserver -kill :1 vncserver :1

To start it

2 Comments
2024/11/06
09:18 UTC

Back To Top