#!/data/data/cpm.termux/files/usr/bin/bash# 更换清华源sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.listsed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.listsed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.listapt update# 安装基础应用apt install vim curl wget git openssh tree htop python tsu -y# 添加快捷键mkdir "$HOME/.termux"cat << EOF > $HOME/.termux/termux.propertiesextra-keys = [ \['ESC','|','/','HOME','UP','END','PGUP'], \['TAB','CTRL','-','LEFT','DOWN','RIGHT','PGDN'] \]EOF# 安装ohmyzshtermux-setup-storageapt updateapt install -y git zshgit clone https://github.com/Cabbagec/termux-ohmyzsh.git "$HOME/termux-ohmyzsh" --depth 1cp "$HOME/.termux/termux.properties" "$Home/termux-ohmyzsh/.termux/"mv "$HOME/.termux" "$HOME/.termux.bak.$(date +%Y.%m.%d-%H:%M:%S)"cp -R "$HOME/termux-ohmyzsh/.termux" "$HOME/.termux"git clone git://github.com/robbyrussell/oh-my-zsh.git "$HOME/.oh-my-zsh" --depth 1mv "$HOME/.zshrc" "$HOME/.zshrc.bak.$(date +%Y.%m.%d-%H:%M:%S)"cp "$HOME/.oh-my-zsh/templates/zshrc.zsh-template" "$HOME/.zshrc"sed -i '/^ZSH_THEME/d' "$HOME/.zshrc"sed -i '1iZSH_THEME="agnoster"' "$HOME/.zshrc"echo "alias chcolor='$HOME/.termux/colors.sh'" >> "$HOME/.zshrc"echo "alias chfont='$HOME/.termux/fonts.sh'" >> "$HOME/.zshrc"git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"chsh -s zshecho "oh-my-zsh install complete!\nChoose your color scheme now~"echo 14|$HOME/.termux/colors.shecho "Choose your font now~"echo 3 |$HOME/.termux/fonts.sh# 修改ohmyzsh主题sed -i 's/agnoster/ys/g' $HOME/.zshrc# 修改登录提醒cat << EOF > $PREFIX/etc/motdBrooke以上内容可以通过修改../usr/etc/motd自定义 EOFcat << EOF > $HOME/.termux/termux.propertiesextra-keys = [ \['ESC','|','/','HOME','UP','END','PGUP'], \['TAB','CTRL','-','LEFT','DOWN','RIGHT','PGDN'] \]EOF# 设置vimcat <<EOF > $HOME/.vimrcset fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1set enc=utf8set fencs=utf8,gbk,gb2312,gb18030set pasteset nu " 显示行号colorscheme desert " 颜色主题syntax on " 打开语法高亮EOFcat $PREFIX/etc/motdecho "Please restart Termux app..."echo -e "更换色彩样式:\nchcolor\n更改字体:\nchfont\n"