代码拉取完成,页面将自动刷新
#!/bin/bash
#字体颜色
red="\e[31;1m" #红
green="\e[32;1m" #绿
yellow="\e[33;1m" #黄
blue="\e[34;1m" #蓝
purple="\e[35;1m" #紫红
cyanine="\e[36;1m" #青蓝
white="\e[0m" #白色
info
CONFIG=/usr/local/bin/.config
msg() { clear;echo -e "\n\t\t$blue[*]$white$1$2$white\n" ;:;} ##自定义通告颜色
enter() { echo -en "\n\n$green按回车继续$white";read op ;:;} ##
error() { colour=$1;command=$2;echo -e "\n$blue[*]$white$colour$command$white";command $command ;:;} ##自定义通告颜色
s=0
##更换源
_Sources(){
_Termux(){
OPTIONS=(
1 "官方源(国外)"
2 "清华源(国内)"
3 "北京外国语源(国内)"
4 "阿里源(国内)"
5 "中科大源(国内)"
6 "取消")
_dialog "首页→更换源sources.list→Termux 源" "请选择" $OPTIONS
sourcesFile="/data/data/com.termux/files/usr/etc/apt/sources.list"
case $op in
1)
cat<<-EOF>$sourcesFile ##官方
# The main termux repository, behind cloudflare cache:
# deb https://packages-cf.termux.dev/apt/termux-main/ stable main
# The main termux repository:
deb https://packages.termux.dev/apt/termux-main/ stable main
EOF
;;
2)
cat<<-EOF>$sourcesFile ##清华
# The termux repository mirror from TUNA:
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main
EOF
;;
3)
cat<<-EOF>$sourcesFile ##北京外国语
# The main termux repository, behind cloudflare cache:
# deb https://packages-cf.termux.dev/apt/termux-main/ stable main
# The main termux repository:
#deb https://packages.termux.dev/apt/termux-main/ stable main
deb https://mirrors.bfsu.edu.cn/termux/apt/termux-main stable main
EOF
;;
4)
cat<<-EOF>$sourcesFile
# The termux repository mirror from aliyun:
deb https://mirrors.aliyun.com/termux/termux-packages-24 stable main
EOF
;;
5)
cat<<-EOF>$sourcesFile
# The termux repository mirror from ustc:
deb https://mirrors.ustc.edu.cn/termux/apt/termux-main stable main
EOF
;;
*)
return
;;
esac
msg $red "更换成功!"
echo -e "$yellow如果网速不能跑满你的宽带网络,请更换其他源$white"
enter
}
_Ubuntu(){
OPTIONS=(
1 "官方源(国外)"
2 "清华源(国内)"
3 "北京外国语源(国内)"
4 "阿里源(国内)"
5 "中科大源(国内)"
6 "网易163源(国内)"
7 "取消")
_dialog "首页→更换源sources.list→Ubuntu 源" "请选择" $OPTIONS
case $op in
1)
cat<<-EOF>/etc/apt/sources.list ##官方
deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ focal universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security multiverse
EOF
;;
2)
cat<<-EOF>/etc/apt/sources.list ##清华arm64
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
EOF
;;
3)
cat<<-EOF>/etc/apt/sources.list ##北京外国语大学
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.bfsu.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
EOF
;;
4)
cat<<-EOF>/etc/apt/sources.list ##阿里云 Arm64,Armhf等
# 默认注释了源码仓库,如有需要可自行取消注释
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ xenial main main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ xenial-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.aliyun.com/ubuntu-ports/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu-ports/ xenial-proposed main restricted universe multiverse
EOF
;;
5)
cat<<-EOF>/etc/apt/sources.list ##中科大 arm64, armhf, PowerPC, ppc64el, s390x
# 默认注释了源码仓库,如有需要可自行取消注释
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main restricted universe multiverse
EOF
;;
6)
cat<<-EOF>/etc/apt/sources.list
deb http://mirrors.163.com/ubuntu-ports// focal main restricted universe multiverse
deb http://mirrors.163.com/ubuntu-ports// focal-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu-ports// focal-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu-ports// focal-backports main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu-ports// focal main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu-ports// focal-security main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu-ports// focal-updates main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu-ports// focal-backports main restricted universe multiverse
## Pre-released source, not recommended.
# deb http://mirrors.163.com/ubuntu-ports// focal-proposed main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu-ports// focal-proposed main restricted universe multiverse
EOF
;;
*)
return
;;
esac
msg $red "更换成功!"
echo -e "$yellow如果网速不能跑满你的宽带网络,请更换其他源$white"
enter
}
OPTIONS=(
1 "Ubuntu 源(arm64,armhf)"
2 "Termux 源(arm64,armhf)"
3 "取消")
_dialog "首页→更换源sources.list" "请选择" $OPTIONS
case $op in
1)
_Ubuntu
;;
2)
_Termux
;;
*)
return
;;
esac
}
_xrdp(){
_i(){
msg $red "安装xrdp DR远程桌面"
sudo apt install xrdp -y
sed -i '6{s/^/xfce4-session/}' /etc/X11/Xsession
echo xfce4-session >~/.xsession
msg $green "安装完毕~"
enter
}
_start(){
OPTIONS=(
1 "[Xvnc模式]"
2 "[Xorg模式]"
3 "取消")
_dialog "首页→xrdp→启动界面" "请选择" $OPTIONS
case $op in
1)
xrdp -k
rm -rf /var/run/xrdp/xrdp.pid
row=`cat /etc/xrdp/xrdp.ini | grep -n '; in sesman.ini. See and configure also sesman.ini.' | awk -F ":" '{print $1}'`
sed -i "$(($row+1)),`cat /etc/xrdp/xrdp.ini | wc -l`"d /etc/xrdp/xrdp.ini
cat <<- EOF >>/etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=5901
#xserverbpp=24
#delay_ms=2000
EOF
xrdp
echo -e "$yellow需要先使用Tiger VNC连接模式$white"
enter
;;
2)
xrdp -k
rm -rf /var/run/xrdp/xrdp.pid
row=`cat /etc/xrdp/xrdp.ini | grep -n '; in sesman.ini. See and configure also sesman.ini.' | awk -F ":" '{print $1}'`
sed -i "$(($row+1)),`cat /etc/xrdp/xrdp.ini | wc -l`"d /etc/xrdp/xrdp.ini
cat <<- EOF >>/etc/xrdp/xrdp.ini
[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=5901
code=20
EOF
xrdp
echo -e "$yellow需要先使用Tiger VNC连接模式$white"
enter
;;
*)
return
;;
esac
}
_d(){
msg $red "卸载xrdp DR远程桌面"
sudo apt purge xrdp -y
msg $green "卸载完毕~"
enter
}
OPTIONS=(
1 "启用xrdp"
2 "安装xrdp DR远程桌面"
3 "卸载xrdp DR远程桌面"
4 "取消")
_dialog "首页→xrdp DR远程桌面" "请选择" $OPTIONS
case $op in
1)
if [ -z "`dpkg -l | grep xrdp`" ];then
echo -e "$red请先安装xrdp!$white"
enter
return
else
_start
fi
;;
2)
_i
;;
3)
_d
;;
*)
return
;;
esac
}
##终端美化
_term(){
echo
}
##作者留言
_other(){
cat<<EOF
hhhhhhh tttt
h:::::h ttt:::t
h:::::h t:::::t
h:::::h t:::::t
h::::h hhhhh zzzzzzzzzzzzzzzzzttttttt:::::ttttttt
h::::hh:::::hhh z:::::::::::::::zt:::::::::::::::::t
h::::::::::::::hh z::::::::::::::z t:::::::::::::::::t
h:::::::hhh::::::h zzzzzzzz::::::z tttttt:::::::tttttt
h::::::h h::::::h z::::::z t:::::t
h:::::h h:::::h z::::::z t:::::t
h:::::h h:::::h z::::::z t:::::t
h:::::h h:::::h z::::::z t:::::t tttttt
h:::::h h:::::h z::::::zzzzzzzz t::::::tttt:::::t
h:::::h h:::::h z::::::::::::::z tt::::::::::::::t
h:::::h h:::::hz:::::::::::::::z tt:::::::::::tt
hhhhhhh hhhhhhhzzzzzzzzzzzzzzzzz ttttttttttt
EOF
echo -e "$red很幸运与你相遇~~$white"
#echo -e "$red 此ubuntu20.04是up主参考了各大教程所创造的版本!$white"
enter
}
_update(){
msg $red "更新ubuntu脚本"
echo -e "\n\t$green------------------------------$white"
echo -e "\t$red ubuntu脚本迭代更新信息$white"
echo -e "\t (1)ubuntu 1.0 最初代脚本$white"
echo -e "\t (2)ubuntu 1.5 $white"
echo -e "\t ●添加_软件安装_功能$white"
echo -e "\t ●添加_桌面美化_功能$white"
echo -e "\t (3)ubuntu 2.0 $white"
echo -e "\t ●支持修复WPS字体$white"
echo -e "\t ●修复若干Bug,添加若干功能$white"
echo -e "\t (4)ubuntu 2.5 $white"
echo -e "\t ●重大更新添加Termux-X11功能!$white"
echo -e "\t (5)ubuntu 2.5.5 $white"
echo -e "\t ●对ubuntu依赖包整合,大大提高ubuntu系统安装速度!$white"
echo -e "\t (6)ubuntu 2.6.0 $red(当前版本)$white"
echo -e "\t ●QQ3.0 For Linux !$white"
echo -e "\t$green------------------------------$white"
echo -e "\n\n\t作者不定时更新脚本,如想体验新功能,更新ubuntu脚本即可体验!"
enter
for x in ubuntu vnc software
do
while :
do
#wget -c "https://raw.githubusercontent.com/WindowHZT/termux-ubuntu2004/main/usr/$x" -O "/tmp/$x"
wget -c "gitee.com/djyd/termux-ubuntu2004/raw/main/usr/$x" -O "/tmp/$x"
if [ ! "$?" == "0" ];then
echo -e "$yellow下载资源失败!请检查网络再继续下载……"
enter
else
mv /tmp/$x /usr/local/bin/$x
chmod +x /usr/local/bin/$x
break
fi
done
done
msg $green "更新完毕~"
enter
exit
}
_clear(){
msg $red "这仅仅是清理脚本产生的垃圾,请悉知!"
enter
echo -e "$yellow清理安装包.$white"
df -hl > /tmp/df
firstdf=`sed -n 2p /tmp/df | awk '{print $5}' | sed "s#%##g"`
rm -rf /opt/*.tar.gz ~/Downloads/VScode.deb /opt/ttf.tar.xz /opt/wps.deb
echo -e "\n$yellow清理美化包..$white"
rm -rf /tmp/.icons/* /tmp/.themes/* /tmp/icons/*
echo -e "\n$yellow保留用户配置,清除多余资源包...$white"
bg_name=`xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorVNC-0/workspace0/last-image | awk -F '/' '{print $NF}'`
themes_name=`xfconf-query -c xsettings -p /Net/ThemeName`
icons_name=`xfconf-query -c xsettings -p /Net/IconThemeName`
mouse_name=`xfconf-query -c xsettings -p /Gtk/CursorThemeName`
echo -e "\t|$green用户背景图:$bg_name$white"
echo -e "\t|$green用户主题:$themes_name$white"
echo -e "\t|$green用户图标:$icons_name$white"
echo -e "\t|$green用户光标:$mouse_name$white"
##清理背景图
if [ -d "/tmp/bg" ];then
cd /tmp/bg
for x in `ls`
do
[ "$x" == "$bg_name" ]&&continue
[ -e "/usr/share/backgrounds/xfce/$x" ]&&sudo rm -rf /usr/share/backgrounds/xfce/$x
done
fi
##清理主题
if [ -d ~/.themes ];then
cd ~/.themes
for x in `ls -F | grep "/$" | sed "s#/##g"`
do
[ "$x" == "$themes_name" ]&&continue
sudo rm -rf $x >/dev/null 2>&1
sudo rm -rf $x/ >/dev/null 2>&1
done
fi
##清理图标
if [ -d ~/.local/share/icons ];then
cd ~/.local/share/icons
for x in `ls -F | grep "/$" | sed "s#/##g"`
do
[ "$x" == "$icons_name" ]&&continue
sudo rm -rf $x >/dev/null 2>&1
sudo rm -rf $x/ >/dev/null 2>&1
done
fi
##清理光标
if [ -d ~/.icons ];then
cd ~/.icons
for x in `ls -F | grep "/$" | sed "s#/##g"`
do
[ "$x" == "$mouse_name" ]&&continue
sudo rm -rf $x >/dev/null 2>&1
sudo rm -rf $x/ >/dev/null 2>&1
done
fi
cd ~
df -hl > /tmp/df
enddf=`sed -n 2p /tmp/df | awk '{print $5}' | sed "s#%##g"`
reslut=`echo "(0.$firstdf-0.$enddf)*108" | bc`
echo -e "\n$yellow此次清理$reslut G垃圾文件$white"
echo -e "\n$green清理完毕~....$white"
rm -rf /tmp/df
enter
}
_dialog(){
export LC_ALL="zh_CN.UTF-8"
export PORT=1
dialog --clear \
--backtitle "$1" \
--title "@参(•̀⌄•́)芜湖起飞" \
--nocancel \
--menu "$2" 20 40 8 \
"${OPTIONS[@]}" \
2>/tmp/menu
export op=`cat /tmp/menu`
}
_fonts(){
fonts=(
"Dengb.tar.xz"
"Dengl.tar.xz"
"Deng.tar.xz"
"fonts.tar.xz"
"FZSTK.tar.xz"
"FZYTK.tar.xz"
"mingliub.tar.xz"
"msjhbd.tar.xz"
"msjh.tar.xz"
"msyhbd.tar.xz"
"msyhl.tar.xz"
"msyh.tar.xz"
"mtextra.tar.xz"
"simfang.tar.xz"
"simhei.tar.xz"
"simkai.tar.xz"
"SIMLI.tar.xz"
"simsunb.tar.xz"
"simsun.tar.xz"
"STCAIYUN.tar.xz"
"STFANGSO.tar.xz"
"STKAITI.tar.xz"
"STSONG.tar.xz"
"STXINGKA.tar.xz"
"symbol.tar.xz"
"WEBDINGS.tar.xz"
"wingding.tar.xz"
"WINGDNG2.tar.xz"
"WINGDNG3.tar.xz"
"fonts1.tar.xz"
"msjhl1.tar.xz"
"msyhbd1.tar.xz"
"msyh1.tar.xz"
)
msg $red "下载WPS缺少的字体"
echo -e "$yellow下载慢的,请考虑使用加速器!$white"
cd /usr/share/fonts/truetype/
n=1
for x in `echo "${fonts[*]}"`
do
while :
do
echo -e "\n$green下载进度($n / ${#fonts[*]})$white"
aria2c -c -x 5 -j 5 -s 5 https://raw.githubusercontent.com/WindowHZT/termux-ubuntu2004/main/mix/$x -d /usr/share/fonts/truetype/
if [ ! "$?" == "0" ];then
echo -e "$yellow下载资源失败!请检查网络,或使用加速器再继续下载……"
enter
else
#xz -d $x
tar -xvhf $x
rm -rf $x
let n++
break
fi
done
done
echo -e "\n\n$green下载完毕!$white"
echo -e "\n$green重新打开WPS即可使用!$white"
echo -e "\n$green通过:设置→外观→字体,也可以更换系统的字体样式!$white"
enter
cd ~
}
_hh(){
msg $red "开始汉化xfce4桌面^_^"
echo -e "$yellow汉化过程比较久,请耐心等待…$white"
sudo dpkg --configure -a
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then
sudo mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
fi
sudo apt update -y
sudo apt upgrade -y
sudo dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs sudo apt install --reinstall -y
sudo dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
| xargs sudo dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs sudo apt install --reinstall -y
sudo dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/locale/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
| xargs sudo dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs sudo apt install --reinstall -y
if sudo dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then
sudo rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
else
sudo dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print " " $2}'
fi
fi
if [ "$(sudo dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then
sudo rm -f /usr/bin/man
sudo dpkg-divert --quiet --remove --rename /usr/bin/man
fi
sudo rm -f /etc/update-motd.d/60-unminimize
echo -e "$green汉化结束!$white"
echo -e "$yellow重新启动系统,获最佳体验!$white"
enter
}
_remotedesktop(){
_vncset(){
OPTIONS=(
1 "使用VNC"
2 "更改分辨率"
3 "修改连接密码"
4 "取消")
_dialog "首页→其他选项→桌面图形连接模式→VNC" "请选择" $OPTIONS
case $op in
1)
clear
sed -i "s#`cat $CONFIG | grep "mode=$mode"`#mode=1#g" $CONFIG
echo -e "\n\n$yellow当前模式:VNC$white"
echo -e "$green推荐安装VNC Viewer,Remote Desktop Manager,AVNC$white"
vnc
enter
;;
2)
vnc changeDPI
;;
3)
vnc changePWD
;;
*)
return
;;
esac
}
_termux-x11(){
OPTIONS=(
1 "使用Termux-X11"
2 "更改DPI"
3 "取消")
_dialog "首页→其他选项→桌面图形连接模式→Termux-X11" "请选择" $OPTIONS
case $op in
1)
clear
sed -i "s#`cat $CONFIG | grep "mode=$mode"`#mode=2#g" $CONFIG
echo -e "\n\n$yellow当前模式:Termux-X11$white"
echo -e "$green推荐安装Termux-X11$white"
echo -e "\n\n$yellow重启生效!$white"
enter
;;
2)
vnc changeDPI
;;
*)
return
;;
esac
}
_xsdl(){
OPTIONS=(
1 "使用Xserver XSDL"
2 "配置Xserver XSDL"
3 "取消")
_dialog "首页→其他选项→桌面图形连接模式→Xserver XSDL" "请选择" $OPTIONS
case $op in
1)
clear
sed -i "s#`cat $CONFIG | grep "mode=$mode"`#mode=3#g" $CONFIG
echo -e "\n\n$yellow当前模式:Xserver XSDL$white"
echo -e "$green推荐安装Xserver XSDL$white"
echo -e "\n\n$yellow当前Xserver XSDL配置如下:$white"
source $CONFIG
echo "DISPLAY=$display"
echo "PULSE_SERVER=$pulse_server"
enter
;;
2)
export LC_ALL=zh_CN.UTF-8
display1=$(dialog --clear --title "Xserver XSDL配置" \
--inputbox "请输入DISPLAY的地址:
(如:10.38.165.117:0)" 8 50 \
3>&1 1>&2 2>&3 3>&-)
pulse_server1=$(dialog --clear --title "Xserver XSDL配置" \
--inputbox "请输入PULSE_SERVER的地址:
(如:10.38.165.117:4713)" 8 50 \
3>&1 1>&2 2>&3 3>&-)
source $CONFIG
sed -i "s#`cat $CONFIG | grep "display=$display"`#display=$display1#g" $CONFIG
sed -i "s#`cat $CONFIG | grep "pulse_server=$pulse_server"`#pulse_server=$pulse_server1#g" $CONFIG
echo -e "\n\n$yellow你的配置如下:$white"
source $CONFIG
echo "DISPLAY=$display"
echo "PULSE_SERVER=$pulse_server"
enter
;;
*)
return
;;
esac
}
OPTIONS=(
1 "VNC"
2 "Termux-X11"
3 "Xserver XSDL"
4 "RD Client(客户端)"
5 "取消")
_dialog "首页→其他选项→桌面图形连接模式" "请选择" $OPTIONS
case $op in
1)
_vncset
;;
2)
_termux-x11
;;
3)
_xsdl
;;
4)
_xrdp
;;
*)
return
;;
esac
}
_otherOP(){
OPTIONS=(
1 "桌面图形连接模式"
2 "版本信息"
3 "清理垃圾"
4 "汉化"
5 "下载WPS字体"
6 "取消")
_dialog "首页→其他选项" "请选择" $OPTIONS
case $op in
1)
_remotedesktop
;;
2)
msg $red "ubuntu设备信息"
echo -e "$green----------------版本-----------------$white"
lsb_release -a
echo -e "$green----------------磁盘-----------------$white"
df -hl
echo -e "$green----------------服务运行状态-----------------$white"
service --status-all
_other
;;
3)
_clear
;;
4)
_hh
;;
5)
_fonts
;;
*)
return
;;
esac
}
_Main(){
CONFIG=/usr/local/bin/.config
OPTIONS=(
1 "软件商店"
2 "桌面美化"
3 "更换源sources.list"
4 "更新ubuntu脚本"
5 "其他选项"
6 "***关机***"
7 "退出脚本")
_dialog "首页" "使用↑↓选择,也可以用手点击选项再回车哦" $OPTIONS
case $op in
1)
source /usr/local/bin/software
_app
;;
2)
source /usr/local/bin/style
_style
;;
3)
_Sources
;;
4)
_update
;;
5)
_otherOP
;;
6)
msg $yellow "关机提示!"
echo -e "*****************************************"
echo -e " ******$red请先确保资料已保存再关机!$white*****"
echo -e "*****************************************"
enter
enter
kill -9 `sudo ps -ef | grep '/data/data/com.termux/files/usr/bin/bash -l' | grep -v grep | awk '{print $2}'`
;;
*)
clear
export s=1
;;
esac
}
while :
do
if [ "$s" == "0" ];then
_Main
else
break
fi
done
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。