From f673c93b6acb97fc1e648677184a5d5cef6e0926 Mon Sep 17 00:00:00 2001 From: xunmi Date: Thu, 25 Jan 2024 17:41:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=80=89=E8=A3=85=E9=80=BB=E8=BE=91=E5=88=A4=E6=96=AD=E5=8F=8D?= =?UTF-8?q?=E4=BA=86=E7=9A=84=E9=97=AE=E9=A2=98,=20=E4=BC=98=E5=8C=96zshrc?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=A2=9E=E5=BC=BA=E9=80=9A=E7=94=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.sh | 15 +++++++-------- 配置/zshrc | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) 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"