-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathx11.sh
96 lines (81 loc) · 3.03 KB
/
x11.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
r="\033[1;31m"
g="\033[1;32m"
c="\033[1;36m"
b="\033[1;34m"
n="\033[0m"
boxg="\033[1;34m[\033[1;32m+\033[1;34m]"
boxr="\033[1;34m[\033[1;31m!\033[1;34m]"
. <(curl -sLo- "https://raw.githubusercontent.com/RUR999/spinner/refs/heads/main/spin.sh")
banner() {
echo -en "\n${b}╔═══╗╔═══╗╔═══╗╔═╦╦═╦╗\n║╔═╗║║╔═╗║║╔═╗║║═╬╣═╣╚╗\n║╚═╝║║╚═╝║║╚═╝║║╔╣╠═║║║\n╚══╗║╚══╗║╚══╗║╚╝╚╩═╩╩╝\n╔══╝║╔══╝║╔══╝║ ${g}By RUR 999\n${b}╚═══╝╚═══╝╚═══╝ \n\n${n}"
}
rurfish(){
echo -en "${boxq} ${g}Do You Want To Install Fish Functions? (y/n)${n} "
read yn
case $yn in
Y|y)
echo -e "${boxg} ${g}Installing Fish Functions${n}"
(curl https://raw.githubusercontent.com/RUR999/999.fish/refs/heads/main/999.sh -o 999.sh) &> /dev/null & spin
bash 999.sh
rm -rf 999.sh
;;
N|n)
echo ""
chsh -s fish
;;
*) echo -e "${boxr} ${r}Wrong Input"
rurfish
;;
esac
}
termux-setup-storage
clear;banner
(pkg update;pkg upgrade -y ) &> /dev/null & spin
pkgs=( x11-repo termux-x11-nightly xfce4 xfce4-goodies tur-repo xcompmgr xmlstarlet )
for pkg in "${pkgs[@]}";do
echo -e "${boxg} ${g}Installing ${pkg}${n}"
(pkg install -y ${pkg}) &> /dev/null & spin
done
echo -e "${boxg}${g} Installing Chromium Browser ${n}"
(pkg install -y chromium) &> /dev/null & spin
echo -e "${boxg}${g} Installing Firefox Browser ${n}"
(pkg install -y firefox) &> /dev/null & spin
echo -e "${boxg}${g} Installing VS Code Editor${n}"
(pkg install -y code-oss) &> /dev/null & spin
echo -e "${boxg}${g} Installing Parole Media Player${n}"
(pkg install -y parole) &> /dev/null & spin
echo -e "${boxg}${g} Installing Ristretto Image Viewer${n}"
(pkg install -y ristretto) &> /dev/null & spin
echo -e "${boxg}${g} Installing inkscape Image Editor${n}"
(pkg install -y inkscape) &> /dev/null & spin
rurfish
rm -rf $PREFIX/bin/x11
rm -rf $PREFIX/bin/stopx11
cat >> $PREFIX/bin/x11 <<- _EOF_
#/data/data/com.termux/files/usr/bin/bash
# Kill open X11 processes
pkill -f com.termux.x11
# pulseaudio sound
pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1
export PULSE_SERVER=127.0.0.1 && pulseaudio --start --disable-shm=1 --exit-idle-time=-1
# Prepare termux-x11 session
export XDG_RUNTIME_DIR=${TMPDIR}
termux-x11 :0 >/dev/null &
# Launch Termux X11 main activity
am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1
sleep 1
# Run XFCE4 Desktop
env DISPLAY=:0 dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1
exit 0
_EOF_
cat >> $PREFIX/bin/stopx11 <<- _EOF_
pkill -f com.termux.x11
_EOF_
chmod +x $PREFIX/bin/x11
chmod +x $PREFIX/bin/stopx11
chsh -s fish
termux-reload-settings
sleep 3
clear;banner
echo -en "${boxg}${g} Just Type ${c}x11 ${g}For Run Termux-x11\n${boxg} ${g}Type ${c}stopx11 ${g}For Stop Termux-x11${n}\n\n\n"