Skip to content

Commit cee751e

Browse files
committed
add macOS script
1 parent f1a96a9 commit cee751e

File tree

8 files changed

+70
-33
lines changed

8 files changed

+70
-33
lines changed

.DS_Store

6 KB
Binary file not shown.

.vscode/launch.json

Whitespace-only changes.

README.md

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,40 @@
22

33
## 介绍
44

5-
这是我自用的一个常用软件批量安装脚本,基于 winget 包管理器。
6-
其中 switch_winget_to_USTCsource.bat 文件用于切换为国内安装源。
7-
software_list.txt 文件为软件安装列表。
8-
software_install.bat 文件为安装执行脚本。
5+
这是我自用的一个 Windows 和 macOS 的软件批量安装脚本。
6+
分别基于 winget 和 homebrew 包管理器。
97

10-
## 软件安装列表
8+
其中 Windows 文件夹内
9+
'switch_winget_to_USTCsource.bat' 文件用于切换为国内安装源。
10+
'software_list.txt' 文件为软件安装列表。
11+
'software_install.bat' 文件为安装执行脚本。
12+
13+
macOS 文件夹内
14+
'packages.txt' 文件为软件安装列表。
15+
'install_packages.sh' 文件为安装执行脚本。
16+
17+
## Windows 软件安装列表
1118

1219
可根据自己的需求,在终端中使用命令 'winget search 关键词' 来搜索安装包,将ID添加到软件安装列表中。
13-
列表中包含
14-
15-
```console
16-
9PKTQ5699M62 (iCloud for Windows)
17-
MSPCManager
18-
Git.Git
19-
Python.Python
20-
Microsoft.VisualStudioCode
21-
Tencent.WeixinDevTools
22-
7zip.7zip
23-
Figma.Figma
24-
Krita.Krita
25-
BlenderFoundation.Blender
26-
Unity.UnityHub
27-
Telegram.TelegramDesktop
28-
Tencent.WeChat
29-
Tencent.TIM
30-
voidtools.Everything
31-
ByteDance.JianyingPro
32-
Daum.PotPlayer
33-
xanderfrangos.twinkletray
34-
Notion.Notion
35-
Obsidian.Obsidian
36-
Yuanli.uTools
37-
QL-Win.QuickLook
38-
nomic.gpt4all
39-
Valve.Steam
40-
```
20+
21+
## macOS 软件安装列表
22+
23+
可根据自己的需求,在终端中使用命令 ' brew search 关键词' 来搜索安装包,将软件名添加到列表文件中。
24+
4125
## 使用方式
4226

27+
### Windows
28+
4329
将压缩包解压到同一个文件夹内
4430
运行 switch_winget_to_USTCsource.bat 文件,将源切换为国内源。
4531
若有更适合你的源可以更换内部链接。
4632

4733
双击 software_install.bat 文件即可。
4834
脚本会自动搜寻,下载,并安装列表文件中的软件。
4935

36+
### macOS
37+
38+
将压缩包解压到同一个文件夹内
39+
打开终端,将 install_packages.sh 文件拖入终端对话框中,回车。
40+
5041
Enjoy it!

macOS/install_packages.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# 切换 Homebrew 源为中国源
4+
echo "Switching Homebrew source to China..."
5+
brew update-reset
6+
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> ~/.bash_profile
7+
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' >> ~/.bash_profile
8+
source ~/.bash_profile
9+
echo "Homebrew source switched to China."
10+
11+
# 定义软件列表文件路径
12+
software_list="packages.txt"
13+
14+
# 检查软件列表文件是否存在
15+
if [ ! -f "$software_list" ]; then
16+
echo "Software list file $software_list not found!"
17+
exit 1
18+
fi
19+
20+
# 逐行读取软件列表文件并安装软件
21+
while IFS= read -r package; do
22+
echo "Checking if $package is installed..."
23+
if brew list --versions "$package" > /dev/null; then
24+
echo "$package is already installed. Skipping."
25+
else
26+
echo "Installing $package..."
27+
brew install "$package"
28+
fi
29+
done < "$software_list"
30+
31+
echo "All software installation completed."

macOS/packages.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Git
2+
Python@3
3+
Visual-Studio-Code
4+
Figma
5+
Krita
6+
Blender
7+
Unity-Hub
8+
Telegram-Desktop
9+
WeChat
10+
Notion
11+
Obsidian
12+
uTools
13+
sfm
14+
flomo
15+
Steam

0 commit comments

Comments
 (0)