From e909e66caec57cc0fa91a20c1abf5f0ec5ab5d8e Mon Sep 17 00:00:00 2001 From: Arno313 Date: Fri, 29 Aug 2025 12:06:26 +0000 Subject: [PATCH] Create testi2 --- testi2 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 testi2 diff --git a/testi2 b/testi2 new file mode 100644 index 0000000..f74645d --- /dev/null +++ b/testi2 @@ -0,0 +1,25 @@ +#!/data/data/com.termux/files/usr/bin/bash + +# Kill open X11 processes +kill -9 $(pgrep -f "termux.x11") 2>/dev/null + +# Enable PulseAudio over Network +pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 + +# Prepare termux-x11 session +export XDG_RUNTIME_DIR=${TMPDIR} +termux-x11 :0 >/dev/null & + +# Wait a bit until termux-x11 gets started. +sleep 3 + +# Launch Termux X11 main activity +am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1 +sleep 1 + +# Login in PRoot Environment. Do some initialization for PulseAudio, /tmp directory +# and run XFCE4 as user Arno. +# See also: https://github.com/termux/proot-distro +# Argument -- acts as terminator of proot-distro login options processing. +# All arguments behind it would not be treated as options of PRoot Distro. +proot-distro login debian --shared-tmp -- /bin/bash -c 'export PULSE_SERVER=127.0.0.1 && export XDG_RUNTIME_DIR=${TMPDIR} && su - droidmaster -c "env DISPLAY=:0 startxfce4"'