diff --git a/start.sh b/start.sh index 67db33e..81ac8b8 100755 --- a/start.sh +++ b/start.sh @@ -59,9 +59,9 @@ Select_Continue() { Show 0 "$1((是/否 Yes/No))" read r if echo "$r" | grep -Eq "^[是Yy][Ee]?[Ss]?$";then - return 1 - else return 0 + else + return 1 fi } @@ -104,19 +104,18 @@ Install_Zsh() { # 下载配置 Download_Config() { # 创建下载文件的临时目录 - GreyStart Show 0 "正在进行插件下载与配置" - # 下载zsh扩展 + GreyStart ohmyzsh_dir=${ROOT_INSTALL}/oh-my-zsh - sudo git clone https://gitcode.com/mirrors/ohmyzsh/ohmyzsh.git ${ohmyzsh_dir} + sudo git clone https://gitcode.com/mirrors/ohmyzsh/ohmyzsh.git ${ohmyzsh_dir} || Show 1 "关键依赖下载失败" cd ${ohmyzsh_dir}/custom/plugins/ sudo git clone https://gitcode.com/mirrors/zsh-users/zsh-autosuggestions.git sudo git clone https://gitcode.com/mirrors/zsh-users/zsh-syntax-highlighting.git # 下载预设配置 config_url=${ROOT_URL}/raw/配置/zshrc sudo wget -t 3 -q --show-progress -c "${config_url}" || Show 1 "无法下载预设配置(${config_url})" - sed -i "s/export ZSH=\/etc\/oh-my-zsh/export ZSH=$ohmyzsh_dir/" zshrc + sudo sed -i "s:export ZSH=/etc/oh-my-zsh:export ZSH=$ohmyzsh_dir:" zshrc sudo mv zshrc /etc/skel/.zshrc cp -v /etc/skel/.zshrc $HOME ColorReset @@ -126,11 +125,11 @@ Download_Config() { # 选配 Select_Config(){ if Select_Continue "启动zsh"; then - zsh + exec zsh Show 2 "zsh启动完成" fi if Select_Continue "将Zsh设置为默认命令行"; then - sudo chsh -s /usr/bin/zsh + chsh -s /usr/bin/zsh Show 2 "已将zsh设置为默认命令行" fi } diff --git a/配置/zshrc b/配置/zshrc index 120cedb..2423192 100644 --- a/配置/zshrc +++ b/配置/zshrc @@ -82,6 +82,6 @@ source $ZSH/oh-my-zsh.sh export LC_ALL="zh_CN.UTF-8" # 别名 -alias ls='lsd' +# alias ls='lsd' alias zshconfig="vim ~/.zshrc"