• Stars
    star
    1,412
  • Rank 33,316 (Top 0.7 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created about 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Termux X11 add-on application.

Termux:X11

Nightly build Join the chat at https://gitter.im/termux/termux Join the Termux discord server

A Termux X11 server add-on app.

About

Termux:X11 is a fully fledged X server. It is built with Android NDK and optimized to be used with Termux.

Submodules caveat

This repo uses submodules. Use

~ $ git clone --recurse-submodules https://github.com/termux/termux-x11 

or

~ $ git clone https://github.com/termux/termux-x11
~ $ cd termux-x11
~ $ git submodule update --init --recursive

How does it work?

Just like any other X server.

Setup Instructions

For this one you must enable the x11-repo repository can be done by executing pkg install x11-repo command

For X applications to work, you must install Termux-x11 companion package. You can do that by downloading an artifact from last successful build and installing termux-x11-*-debug.apk (according to device architecture, universal if you are doubting) and *.deb (if you use termux with pkg) or *.tar.xz (if you use termux with pacman) files from termux-companion packages artifact (do not try to install shell-loader-nightly.apk as Android application, it is not intended to be installed, it is only for chroot users). Or you can install nightly companion package from repositories with pkg in x11-repo && pkg in termux-x11-nightly

Running Graphical Applications

You can start your desired graphical application by doing:

~ $ termux-x11 :1 -xstartup "dbus-launch --exit-with-session xfce4-session"

or

~ $ termux-x11 :1 &
~ $ env DISPLAY=:1 dbus-launch --exit-with-session xfce4-session

You may replace xfce4-session if you use other than Xfce

dbus-launch does not work for some users so you can start session with

~ $ termux-x11 :1 -xstartup "xfce4-session"

If you're done using Termux:X11 just simply exit it through it's notification drawer by expanding the Termux:X11 notification then "Exit" But you should pay attention that termux-x11 command is still running and can not be killed this way.

Using with proot environment

If you plan to use the program with proot, keep in mind that you need to launch proot/proot-distro with the --shared-tmp option. If passing this option is not possible, set the TMPDIR environment variable to point to the directory that corresponds to /tmp in the target container. If you are using proot-distro you should know that it is possible to start termux-x11 command from inside proot container.

Using with chroot environment

If you plan to use the program with chroot or unshare, you must to run it as root and set the TMPDIR environment variable to point to the directory that corresponds to /tmp in the target container. This directory must be accessible from the shell from which you launch termux-x11, i.e. it must be in the same SELinux context, same mount namespace, and so on. Also you must set XKB_CONFIG_ROOT environment variable pointing to container's /usr/share/X11/xkb directory, otherwise you will have xkbcomp-related errors. You can get loader for nightly build from an artifact of last successful build

export TMPDIR=/path/to/chroot/container/tmp
export CLASSPATH=$(/system/bin/pm path com.termux.x11 | cut -d: -f2)
/system/bin/app_process / com.termux.x11.CmdEntryPoint :0

Logs

If you need to obtain logs from the com.termux.x11 application, set the TERMUX_X11_DEBUG environment variable to 1, like this: TERMUX_X11_DEBUG=1 termux-x11 :0

The log obtained in this way can be quite long. It's better to redirect the output of the command to a file right away.

Notification

In Android 13 post notifications was restricted so you should explicitly let Termux:X11 show you notifications.

Video
img_enable-notifications.3.webm

Preferences: You can access preferences menu three ways:

By clicking "PREFERENCES" button on main screen when no client connected.

image

By clicking "Preferences" button in notification, if available.

image

By clicking "Preferences" application shortcut (long tap `Termux:X11` icon in launcher).

image

Touch gestures

Touchpad emulation mode.

In touchpad emulation mode you can use the following gestures:

  • Tap for click
  • Double tap for double click
  • Two-finger tap for right click
  • Three-finger tap for middle click
  • Two-finger vertical swipe for vertical scroll
  • Two-finger horizontal swipe for horizontal scroll
  • Three-finger swipe down to show-hide additional keys bar.

Mouse emulation mode.

In touchpad emulation mode you can use the following gestures:

  • Mouse is in click mode as long as you hold finger on a screen.
  • Double tap for double click
  • Two-finger tap for right click
  • Three-finger tap for middle click
  • Two-finger vertical swipe for vertical scroll
  • Two-finger horizontal swipe for horizontal scroll
  • Three-finger swipe down to show-hide additional keys bar.

Font or scaling is too big!

Some apps may have issues with X server regarding DPI. please see https://wiki.archlinux.org/title/HiDPI on how to override application-specific DPI or scaling.

You can fix this in your window manager settings (in the case of xfce4 and lxqt via Applications Menu > Settings > Appearance). Look for the DPI value, if it is disabled enable it and adjust its value until the fonts are the appropriate size.

Screenshot

image

Also you can start termux-x11 with -dpi option.

~ $ termux-x11 :1 -xstartup "xfce4-session" -dpi 120

Using with 3rd party apps

It is possible to use Termux:X11 with 3rd party apps. Check how shell-loader/src/main/java/com/termux/x11/Loader.java works.

License

Released under the GPLv3 license.

More Repositories

1

termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
Java
34,406
star
2

termux-packages

A package build system for Termux.
Shell
12,914
star
3

termux-api

Termux add-on app which exposes device functionality as API to command line programs.
Java
2,204
star
4

proot-distro

An utility for managing installations of the Linux distributions in Termux.
Shell
1,403
star
5

termux-styling

Termux add-on app for customizing the terminal font and color theme.
Kotlin
1,142
star
6

termux-api-package

Termux package containing scripts to call functionality in Termux:API.
Shell
1,015
star
7

termux-root-packages

Termux packages that are only usable by root users.
Shell
1,012
star
8

termux-widget

Termux add-on app which adds shortcuts to commands on the home screen.
Java
923
star
9

termux-tasker

Termux add-on app for integration with Tasker.
Java
850
star
10

termux-boot

Termux add-on app allowing programs to be run at boot.
Java
800
star
11

proot

An chroot-like implementation using ptrace.
C
747
star
12

termux.github.io

The main termux site and help pages.
HTML
746
star
13

termux-gui

A plugin for Termux to use native Android GUI components from CLI applications.
Kotlin
570
star
14

x11-packages

A set of packages using X11 Windows System.
Shell
535
star
15

termux-docker

Termux environment packaged as Docker image.
Dockerfile
435
star
16

termux-float

Termux add-on app to show the terminal in a floating terminal window.
Java
414
star
17

termux-create-package

Python script to create Termux packages easily.
Python
388
star
18

game-packages

Games for Termux
Shell
308
star
19

termux-services

Scripts to handle services in termux.
Shell
293
star
20

termux-apt-repo

Script to create Termux apt repositories.
Python
286
star
21

termux-tools

Scripts and small programs that are packaged into termux's termux-tools package
Shell
210
star
22

science-packages

Science packages for Termux
C
207
star
23

termux-elf-cleaner

Utility to remove unused ELF sections causing warnings.
C
200
star
24

termux-exec

A execve() wrapper to fix problem with shebangs.
C
161
star
25

command-not-found

Utility for suggesting packages in case typed command was not found.
C++
157
star
26

play-audio

Command-line tool to play audio using OpenSL ES.
C++
122
star
27

termux-auth

Password authentication utilities for Termux.
C
116
star
28

libandroid-shmem

System V shared memory emulation on Android using ashmem.
C
114
star
29

TermuxAm

Android Oreo-compatible am command reimplementation.
Java
98
star
30

termux-packaging

Termux packaging tools.
Rust
90
star
31

repology-metadata

Scripts and Github Actions workflow for generating Repology metadata.
Shell
77
star
32

termux-language-server

🛠️ A language server for some specific bash scripts
Python
73
star
33

termux-root-packages-21-bin

termux-root-packages debs for android 5 and 6. Archived from Bintray repository.
53
star
34

termux-failsafe

An app providing a way to launch failsafe sessions.
Kotlin
47
star
35

wcwidth

A Unicode 15-conformant implementation of wcwidth() in C.
C
40
star
36

termux.com

Sync for termux.github.io/termux.dev at termux.com
39
star
37

libandroid-support

C
32
star
38

termux-am-socket

Faster termux-am implementation that connects to a receiver in termux-app using a unix socket
Shell
32
star
39

science-packages-21-bin

science-package debs for android 5 and 6. Archived from Bintray repository.
25
star
40

getconf

A simple standalone getconf(1) implementation.
C
25
star
41

game-packages-21-bin

game-package debs for android 5 and 6. Archived from Bintray repository.
24
star
42

whatprovides

Utility to find out packages using specific files. Deprecated in favor of apt-file.
Shell
22
star
43

shared-library-testcase

Test case for shared library symbol visibility on dlopen().
C
14
star
44

termux-am-library

Java
14
star
45

distfiles

Moved from https://dl.bintray.com/termux/upstream
11
star
46

create-conventional-changelog

Shell
7
star
47

glibc-packages

Glibc packages for termux (repository mirror)
Shell
7
star
48

termux-community

5
star
49

libandroid-utimes

Library with futimes, futimesat, lutimes from bionic
C
2
star