Repo

返回

Mac 重装软件安装脚本

#env#
发布于 2024-06-05

安装 Clash.Verge1.7.6

Intel 芯片 Apple 芯片

安装脚本

#! /bin/bash
# 安装 Homebrew
install_homebrew(){
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
}
cat << -EOF
############################################################
# 开始安装 brew
############################################################
-EOF
# 这里只是用于提示用户,使用Ctrl C退出
read -t 5 -p "按下任意键继续,如需退出,请按Ctrl C,倒计时5秒" user_command
if command -v brew > /dev/null 2>&1; then
echo -e '\n您的Mac已经安装了Homebrew,即将为您安装列表中的软件包🍻 \n'
else
echo -e '\n您的Mac OS尚未安装Homebrew,正准备为您安装🍻 \n'
install_homebrew
brew update
fi
echo -e "安装 losevka 字体"
brew install font-iosevka --cask
echo -e "安装 oh-my-zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
cd ~
echo -e "安装 zsh-autosuggestions 插件"
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
echo -e "安装 zsh-syntax-highlighting 插件"
git clone https://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
echo -e "安装 dracula 主题"
git clone https://github.com/dracula/zsh.git $ZSH_CUSTOM/themes/dracula
ln -s $ZSH_CUSTOM/themes/dracula/dracula.zsh-theme $OH_MY_ZSH/themes/dracula.zsh-theme
echo -e "复制 .zshrc 配置"
cp .zshrc ~/.zshrc
echo -e "查看安装的 shell"
cat /etc/shells
echo -e "切换默认 shell 为 zsh"
chsh -s /bin/zsh
echo -e "更新配置"
source ~/.zshrc
cat << -EOF
############################################################
# zsh 安装完毕
# 使用 brew 来安装 app
############################################################
-EOF
# GUI软件包清单
# 在这里添加或者删除你需要的GUI软件包名称
brew_cask_app_list=(
microsoft-edge
clash-verge-rev
bob
qq
qqmusic
wechat
wechatwebdevtools
visual-studio-code
warp
iina
setapp
maczip
)
# CLI软件包清单
brew_cli_app_list=(
node@20
)
# 安装GUI软件包
install_cask_app(){
for app in ${brew_cask_app_list[@]}; do
brew install $app --cask
done
}
# 安装CLI软件包
install_cli_app(){
for app in ${brew_cli_app_list[@]}; do
brew install $app
done
}
# CLI软件包清单
install_cli_app
# 安装GUI软件包
install_cask_app
# 清理历史版本的包缓存
brew cleanup
最后编辑于 2024-08-18