You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
484 B

#!/data/data/me.sergiotarxz.openmg.x11/files/usr/bin/bash
DISPLAYNO=0
socket_is_open() {
local SOCKET=$PREFIX/tmp/.X11-unix/X$DISPLAYNO
local NULL=/dev/null
socat -u OPEN:$NULL UNIX-CONNECT:$SOCKET > $NULL 2>&1
return $?
}
/data/data/me.sergiotarxz.openmg.x11/files/usr/bin/termux-x11 :$DISPLAYNO &
{
#kill this script if termux-x11 is not up after 10 seconds
sleep 10
kill $$
} &
until socket_is_open; do
sleep 0.1
done
export DISPLAY=:$DISPLAYNO
exec x-session-manager