Mac M4 软件初始化记录

AI 摘要: 本文是对Mac M4机器重新初始化配置的简要备注,主要包括Mac必备软件、工具初始化、效率工具、办公软件和其他软件配置等内容。其中包括iTerm2、brew软件安装、Mac初始化脚本、插件Atime安装、Karibiner、Alfred、Chrome浏览器、Notion、Xnip、Bartender5、Jetbrains、VSCode配置、Driwio、hammerspoon、RapidAPI、Privoxy、Colima等软件和工具。另外还介绍了些Mac的效率工具、办公软件和其他一些推荐的软件。

1. 背景

最近电脑置换后,需要重新初始化下 Mac M4 机器,尝试了两次 Mac 同步都失败了(因为 M1 的数据太大 600 多 G),索性花了一个周末时间倒腾了下新的电脑软件配置,简要备注下

2. 工具初始化

2.1. MAC 必备

软件名软件说明链接地址是否已安装
iTerm2- 编辑器(oh-my-zsh)https://ohmyz.sh/
brew 软件安装git、autossh、autojump,corkscrew(可以向临时打通 1055 网络)可以先临时 SSH Socks 加速
Mac 初始化脚本ssh -T git@github.comhttps://github.com/lupguo/private_scripts
iTerm2基于 private 安装 restart_autossh.sh、proxycommand、pac 三件套依赖 private_script
启动 Shell~/.my.sh,软连接到private_scripts/Mac/config/.my.sh依赖 private_script(private_scripts/Mac/config/.my.sh
brew 安装echo ’eval “$(/opt/homebrew/bin/brew shellenv)”’ » /Users/lupingguo/.zprofilehttps://brew.sh/
/data 目录问题系统级配置在根目录下创建一个虚拟的符号链接,指向用户可写入的位置(推荐长期使用)cat /etc/synthetic.confdata private/data
插件 Atime 安装自己写的一个 oh-my-zsh 主题,需要加到 ~/.oh-my-zsh/custom/themes依赖 private_script(private_scripts/mac/config/oh-my-zsh
Karibiner支持左 Shift 切换输入中英法切换https://karabiner-elements.pqrs.org/
Alfred替换切换https://www.alfredapp.com/
Chrome 浏览器插件 Chorme 都自动同步,需要自己同步一个自己写的 pac 插件https://www.google.com/chrome/
Notion笔记信息,Google 帐户登陆https://www.notion.com/download
Xnip截图软件,AppleStore 恢复购买https://xnipapp.com/
Bartender5Mac 导航缩减,License 恢复https://www.macbartender.com/
Jetbrains支持配置同步和配置导出,IDE 配置基于帐号同步,Plugin 需要单独下载https://www.jetbrains.com/
VSCode 配置支持配置同步很方便,相关快捷键已同步到 Githubhttps://github.com/lupguo/vscode-settings
Driwio画图https://www.drawio.com/
hammerspoon快捷打开 Apphttps://www.hammerspoon.org/
RapidAPI类似 Postman 接口调试工具https://rapidapi.com/
PrivoxySocks 转 HTTP 代理\
ColimaMac 下替代 Docker 客户端的容器工具,非常 Nicehttps://github.com/abiosoft/colima

2.2. Mac 效率工具

软件名软件说明链接是否已安装
NextChatOpenAI LLM 模型客户端工具(只能降级到 2.15.3 版本)https://github.com/ChatGPTNextWeb/NextChat
PopClipMac 划线选择增强(非常安逸)https://www.popclip.app/download
Bob翻译+AI 自定义AppStore 下载
Eudic词典+生词本https://www.eudic.net/v4/en/app/eudic
Itsycal日历https://www.mowglii.com/itsycal/
Alfred替换 Spotlight,支持最新 copy 内容回溯、快速 Google 检索、AI 问题AppStore 下载
Flow番茄钟AppStore
Magnet.app分屏软件https://magnet.crowdcafe.com/
Things.appTODOAppStore
SwithHosts本地域名解析配置https://switchhosts.vercel.app/zh
ChatWiseAI 客户端https://chatwise.app/
Cursor最近新增\

2.3. Mac 办公

软件名软件说明
iOA
WeCom
WeTerm
Office 套件⭕️
腾讯会议

2.4. Mac 其他

f.lux调色
微信读书AppStore
微信\

3. 软件配置

3.1. 前置网络、基础软件安装

brew 安装软件

1
2
3
# brew安装软件
brew install autossh,autojump,go
...

基于 private_script 脚本配置网络:

  1. lanuch autopac配置
  2. restart_socks配置

3.2. PopClip 配置

插件位置

目录位置:~/Library/Application Support/PopClip/Extensions

PopClip软件的插件安装

插件配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Wisdom
- ApiHost: https://wisdom.sapaude.tech
- ApiKey: ***

# Notion Digest
- Integrations: ***
- PageId: ***
- FirstBlockId: ***

# Search URL
- SearchURL: https://www.google.com/search?q=***

# En\Zh翻译

3.3. Oh-my-zsh 配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
# 历史补全
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

# 配置
ZSH_THEME="atime"
# 插件
plugins=(
    zsh-autosuggestions
    zsh-syntax-highlighting
    git
    git-prompt
    colorize
    colored-man-pages
    jump
    pip
    python
    brew
    docker
    docker-compose
    kubectl
)

3.4. 输入法 Shift 切换配置

  • 输入法调整:基于坐

    • Fn 取消功能(Icons),修改 Fn 为功能按键
    • Keyboard 的预测(Show predictive completions)关闭
  • Karibiner 配置

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    {
      "description": "Change L_Shift to right_command+right_option+f1 to switch EN/ZH",
      "manipulators": [
        {
          "from": {
            "key_code": "left_shift",
            "modifiers": { "optional": ["any"] }
          },
          "to": [
            {
              "key_code": "left_shift",
              "lazy": true
            }
          ],
          "to_if_alone": [
            {
              "key_code": "f1",
              "modifiers": ["right_command", "right_option"]
            }
          ],
          "type": "basic"
        }
      ]
    }
    

    修改 Karabiner 基础参数 alt text

3.5. autopac 设置

支持 mac 下自动设置 PAC,一些launchctl常用命令

1
2
3
4
5
6
7
  264  launchctl load ~/Library/LaunchAgents/com.tkstorm.autopac.plist
  265  launchctl list | grep com.tkstorm.autopac
  271  launchctl unload ~/Library/LaunchAgents/com.tkstorm.autopac.plist
 1967  launchctl list | grep com.tkstorm.autopac
 1968  launchctl stop com.tkstorm.autopac
 1969  launchctl start com.tkstorm.autopac
 3550* launchctl status

vim ~/Library/LaunchAgents/com.tkstorm.autopac.plist

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$ cat ~/Library/LaunchAgents/com.tkstorm.autopac.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.tkstorm.autopac</string>

    <key>ProgramArguments</key>
    <array>
        <string>/private/data/projects/github.com/lupguo/private_scripts/mac/network/autopac/autopac.py</string>
    </array>

    <key>RunAtLoad</key>
    <true/>

    <key>KeepAlive</key>
    <false/>

    <key>StandardErrorPath</key>
    <string>/tmp/autopac.err</string>
    <key>StandardOutPath</key>
    <string>/tmp/autopac.out</string>
</dict>
</plist>

3.6. HammerSpoon 配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
local function openApp(appName)
    local app = hs.application.get(appName)
    if not app then
        hs.application.launchOrFocus(appName)
    else
        app:activate()
    end
end

-- alt+ a - z
hs.hotkey.bind({'alt'}, 'r', function() openApp("Chatwise") end)
hs.hotkey.bind({'alt'}, 'b', function() openApp("Notion") end)
hs.hotkey.bind({'alt'}, 'f', function() openApp("Google Chrome") end)

-- f1 - f12
hs.hotkey.bind({'alt'}, 'f1', function() openApp("iTerm") end)

4. Mac 软件 - 付费&免费软件

Mac软件合集