1. #!/data/data/cpm.termux/files/usr/bin/bash
    2. # 更换清华源
    3. sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
    4. sed -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.list
    5. sed -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.list
    6. apt update
    7. # 安装基础应用
    8. apt install vim curl wget git openssh tree htop python tsu -y
    9. # 添加快捷键
    10. mkdir "$HOME/.termux"
    11. cat << EOF > $HOME/.termux/termux.properties
    12. extra-keys = [ \
    13. ['ESC','|','/','HOME','UP','END','PGUP'], \
    14. ['TAB','CTRL','-','LEFT','DOWN','RIGHT','PGDN'] \
    15. ]
    16. EOF
    17. # 安装ohmyzsh
    18. termux-setup-storage
    19. apt update
    20. apt install -y git zsh
    21. git clone https://github.com/Cabbagec/termux-ohmyzsh.git "$HOME/termux-ohmyzsh" --depth 1
    22. cp "$HOME/.termux/termux.properties" "$Home/termux-ohmyzsh/.termux/"
    23. mv "$HOME/.termux" "$HOME/.termux.bak.$(date +%Y.%m.%d-%H:%M:%S)"
    24. cp -R "$HOME/termux-ohmyzsh/.termux" "$HOME/.termux"
    25. git clone git://github.com/robbyrussell/oh-my-zsh.git "$HOME/.oh-my-zsh" --depth 1
    26. mv "$HOME/.zshrc" "$HOME/.zshrc.bak.$(date +%Y.%m.%d-%H:%M:%S)"
    27. cp "$HOME/.oh-my-zsh/templates/zshrc.zsh-template" "$HOME/.zshrc"
    28. sed -i '/^ZSH_THEME/d' "$HOME/.zshrc"
    29. sed -i '1iZSH_THEME="agnoster"' "$HOME/.zshrc"
    30. echo "alias chcolor='$HOME/.termux/colors.sh'" >> "$HOME/.zshrc"
    31. echo "alias chfont='$HOME/.termux/fonts.sh'" >> "$HOME/.zshrc"
    32. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1
    33. echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"
    34. chsh -s zsh
    35. echo "oh-my-zsh install complete!\nChoose your color scheme now~"
    36. echo 14|$HOME/.termux/colors.sh
    37. echo "Choose your font now~"
    38. echo 3 |$HOME/.termux/fonts.sh
    39. # 修改ohmyzsh主题
    40. sed -i 's/agnoster/ys/g' $HOME/.zshrc
    41. # 修改登录提醒
    42. cat << EOF > $PREFIX/etc/motd
    43. Brooke
    44. 以上内容可以通过修改../usr/etc/motd自定义
    45. EOF
    46. cat << EOF > $HOME/.termux/termux.properties
    47. extra-keys = [ \
    48. ['ESC','|','/','HOME','UP','END','PGUP'], \
    49. ['TAB','CTRL','-','LEFT','DOWN','RIGHT','PGDN'] \
    50. ]
    51. EOF
    52. # 设置vim
    53. cat <<EOF > $HOME/.vimrc
    54. set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
    55. set enc=utf8
    56. set fencs=utf8,gbk,gb2312,gb18030
    57. set paste
    58. set nu " 显示行号
    59. colorscheme desert " 颜色主题
    60. syntax on " 打开语法高亮
    61. EOF
    62. cat $PREFIX/etc/motd
    63. echo "Please restart Termux app..."
    64. echo -e "更换色彩样式:\nchcolor\n更改字体:\nchfont\n"