clear
if which ratpoison > /dev/null 2>/dev/null;then
sleep .01
else
export rptarurl=`lynx -listonly -nonumbers --dump https://www.nongnu.org/ratpoison/|grep -w tar|head -n 1|sed "s|http:|https:|g"`
export rpver=`basename $rptarurl|cut -f 2 -d -|sed "s|.tar.xz||g"`
export rpwd=`mktemp -d`
cd $rpwd
while true;do
if curl -L $rptarurl|tar -xJ;then
break
else
continue
fi
done
cd ratpoison-$rpver
./configure --prefix=/data/data/com.termux/files/usr
make
make install
cd
rm -rf $rpwd
unset rptarurl
unset rpver
unset rpwd
fi
clear
if pgrep -af qemu|grep -q aac > /dev/null 2>/dev/null;then
sleep .01
else
if pactl list modules|grep -qw 2727;then
sleep .01
else
sed -i "s|; exit-idle-time = 20|exit-idle-time = -1|g" $PREFIX/etc/pulse/daemon.conf
pactl info
pactl load-module module-native-protocol-tcp auth-anonymous=yes auth-ip-acl=127.0.0.1 listen=127.0.0.1 port=2727
fi
if pactl list modules|grep -qw module-sles-source;then
sleep .01
else
pactl load-module module-sles-source
fi
export PULSE_SERVER=127.0.0.1:2727 
clear
if pgrep -af Xvnc|grep -qw :4;then
sleep .01
else
Xvnc -nolisten tcp :4 -geometry 1080x2298 -interface 127.0.0.1 -securitytypes none > /dev/null 2>/dev/null&
sleep .25
export DISPLAY=:4
ratpoison&
fi
clear
if [ -d ~/aac ];then
cd ~/aac
clear
if [ -e aac.orig ];then
sleep .01
else
while true;do
if curl -C - -Lo aac.orig https://nashcentral.duckdns.org/projects/vmsrc/aac.qcow2;then
mv aac.orig aac.qcow2
echo > aac.orig
break
else
continue
fi
done
fi
clear
if [ -e aac.qcow2 ];then
sleep .01
else
qemu-img create -f qcow2 -o backing_file=aac.orig,backing_fmt=qcow2 aac.qcow2
fi
clear
if [ -e aac.vnc.json ];then
sleep .01
else
while true;do
if curl -LO https://nashcentral.duckdns.org/aacres/aac.vnc.json;then
cp aac.vnc.json /sdcard/Download/
break
else
continue
fi
done
fi
clear
if [ -e aac.bat ];then
ratpoison -c 'exec sh -c "cd ~/aac;./aac.bat"'&
sleep .25
clear
cd $OLDPWD
else
while true;do
if curl -Lo aac.bat https://nashcentral.duckdns.org/aacres/aacvm.bat;then
echo ratpoison -c quit >> aac.bat
echo kill -9 \`pgrep -af Xvnc\|grep -w :4\|cut -f 1 -d \\   \` >> aac.bat
chmod 700 aac.bat
break
else
continue
fi
done
ratpoison -c 'exec sh -c "cd ~/aac;./aac.bat"'&
sleep .25
clear
cd $OLDPWD
fi
fi
fi
cd
