Termux X11 add-on application.
Go to file
2023-06-05 15:33:49 +03:00
.github make separate artifacts (#323) 2023-05-28 14:05:51 +03:00
app Fixing GLX screen destroying sequence, changing companion package name. 2023-06-05 15:33:49 +03:00
gradle/wrapper Big update. Replacing Xvfb and Xwayland with builtin X server. 2023-05-25 06:27:03 +03:00
img Getting rid of wayland scanner, bumping dependencies versions, fixing fake compositor to work with Xwayland 23.1.0. 2023-03-26 09:38:39 +03:00
shell-loader Big update. Replacing Xvfb and Xwayland with builtin X server. 2023-05-25 06:27:03 +03:00
.gitignore Let Termux:X11 run without sharedUserId="com.termux" (#31) 2021-10-03 13:33:10 +03:00
.gitmodules Various fixes 2023-05-28 05:13:49 +03:00
build_termux_package Fixing GLX screen destroying sequence, changing companion package name. 2023-06-05 15:33:49 +03:00
build.gradle Reduce apk size: exclude libc++_shared from build. 2023-06-04 17:51:57 +03:00
gradle.properties Enable jetifier and androidx in gradle.properties 2021-08-26 18:42:38 +05:30
gradlew Update Gradle Wrapper from 7.6 to 8.0.1. 2023-02-27 15:22:17 +05:30
gradlew.bat Update Gradle Wrapper from 7.5.1 to 7.6. (#184) 2022-12-03 11:10:13 +02:00
LICENSE Create LICENSE 2019-08-26 06:29:04 +03:00
README.md Some fixes. 2023-05-28 13:26:50 +03:00
settings.gradle Implementing experimental X11 client. 2023-03-09 02:31:15 +02:00
termux-x11 Cursor positioning fix. Starter is moved to main apk. Implemented shell-loader which loads started dynamically from main apk to avoid version mismatches between main apk and starter. 2023-02-17 13:22:08 +02:00

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 *.apk and *.deb (if you use termux with pkg) or *.tar.xz (if you use termux with pacman) files. 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 &
~ $ env DISPLAY=:1 dbus-launch --exit-with-session xfce4-session

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

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 XKB_CONFIG_ROOT=/path/to/chroot/container/usr/share/xkb
export TMPDIR=/path/to/chroot/container/tmp
export CLASSPATH=/path/to/loader.apk
/system/bin/app_process / com.termux.x11.Loader :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.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 choose desired DPI in preferences of Termux:X11 app

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.