{"id":22878719,"url":"https://github.com/chicunic/macos-init","last_synced_at":"2025-03-31T14:29:55.025Z","repository":{"id":207103142,"uuid":"718414833","full_name":"chicunic/macOS-init","owner":"chicunic","description":"commands for initialize a new macOS device","archived":false,"fork":false,"pushed_at":"2025-02-17T16:18:08.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T17:24:54.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chicunic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-14T02:51:02.000Z","updated_at":"2025-02-17T16:18:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc19f0a5-9735-4ae9-a527-2f4d97daecc3","html_url":"https://github.com/chicunic/macOS-init","commit_stats":null,"previous_names":["chicunic/macos-init"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2FmacOS-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2FmacOS-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2FmacOS-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicunic%2FmacOS-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chicunic","download_url":"https://codeload.github.com/chicunic/macOS-init/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246482657,"owners_count":20784738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T16:30:56.108Z","updated_at":"2025-03-31T14:29:55.019Z","avatar_url":"https://github.com/chicunic.png","language":"Shell","readme":"# macOS-init\n\n适用于 macOS 的初始化脚本，用于安装常用软件和配置系统。\n\n## LaunchPad\n\n- 还原 LaunchPad 图标布局 (无效)\n\n  ```bash\n  defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock\n  ```\n\n- 锁定 Dock 栏位置 (左边 / 底部 / 右边)\n\n  ```bash\n  defaults write com.apple.Dock position-immutable -bool true; killall Dock\n  ```\n\n- 设置 Dock 栏高度\n\n  ```bash\n  defaults write com.apple.Dock tilesize -int 44; killall Dock\n  ```\n\n- 锁定 Dock 栏高度\n\n  ```bash\n  defaults write com.apple.Dock size-immutable -bool true; killall Dock\n  ```\n\n- 锁定 Dock 栏图标内容 (可选)\n\n  ```bash\n  defaults write com.apple.Dock contents-immutable -bool true; killall Dock\n  ```\n\n## Screenshots\n\n- 修改截图文件名前缀\n\n  ```bash\n  defaults write com.apple.screencapture name \"Screenshot\"\n  ```\n\n- 修改截图文件保存路径\n\n  ```bash\n  mkdir -p ~/Pictures/Screenshots\n  defaults write com.apple.screencapture location ~/Pictures/Screenshots\n  ```\n\n## Xcode\n\n- 安装 Xcode\n\n  - 通过 AppStore 安装(推荐) [Xcode](https://apps.apple.com/us/app/xcode/id497799835?l=zh-Hans-CN\u0026mt=12)\n\n  - 下载安装包(不推荐) [官方网站](https://developer.apple.com/cn/xcode/)\n\n- 安装 Xcode Command Line Tools\n\n  ```bash\n  xcode-select --install\n  ```\n\n- 查看 Xcode Command Line Tools 路径\n\n  ```bash\n  xcode-select -p\n  ```\n\n## oh-my-zsh\n\n- 安装 oh-my-zsh [官方网站](https://ohmyz.sh/#install)\n\n  ```bash\n  sh -c \"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\"\n  ```\n\n## Homebrew\n\n- 安装 Homebrew [官方网站](https://brew.sh/zh-cn/)\n\n  ```bash\n  /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n  ```\n\n- 配置环境变量\n\n  ```bash\n  echo 'eval \"$(/opt/homebrew/bin/brew shellenv)\"' \u003e\u003e ~/.zprofile\n  eval \"$(/opt/homebrew/bin/brew shellenv)\"\n  ```\n\n- 安装常用的 formulae\n\n  ```bash\n  brew install autojump gh git openssh zsh\n  ```\n\n- 检查 formulae 更新\n\n  ```bash\n  brew update\n  brew outdated\n  brew upgrade\n  ```\n\n- 启用 cask 更新检查\n\n  ```bash\n  brew tap buo/cask-upgrade\n  ```\n\n- 检查 cask 更新\n\n    ```bash\n    brew cu -a\n    ```\n\n- 安装常用的 cask\n\n  ```bash\n  brew install adobe-acrobat-reader appcleaner google-chrome iina iterm2 keka kekaexternalhelper\n  ```\n\n- 清理 Homebrew 缓存\n\n  ```bash\n  brew cleanup\n  brew cleanup -s --prune=all\n  ```\n\n## iTerm2\n\n- 配置关闭所有窗口时退出 iTerm2\n\n  iTerm2 -\u003e Settings -\u003e General -\u003e Closing, 选中 Quit when all windows are closed\n\n- 禁用鼠标点击选中命令\n\n  iTerm2 -\u003e Settings -\u003e General -\u003e Selection, 取消选中 Click on a command selects it to restrict Find and Filter\n\n- 修改主题颜色为黑色\n\n  iTerm2 -\u003e Settings -\u003e Profiles -\u003e Colors, 取消选中 Use different colors for light mode and dark mode, Color Presets 选择 Dark Background\n\n## GitHub\n\n- 配置 SSH Key\n\n  ```bash\n  ssh-keygen -t ed25519 -C \"your_email@example.com\"\n  ```\n\n  列出 GPG Key\n\n  ```bash\n  gpg --list-secret-keys --keyid-format=long\n  ```\n\n- 配置 GitHub 账号\n\n  ```bash\n  gh auth login\n  git config --global user.name \"your_name\"\n  git config --global user.email \"your_email@example.com\"\n  git config --global user.signingkey 0123456789ABCDEF\n  git config --global commit.gpgsign true\n  ```\n\n## 安装常用字体\n\n- Source Han Sans 思源黑体 [官方网站](https://github.com/adobe-fonts/source-han-sans/releases)\n\n  下载 Static Super OTC 解压后双击安装\n\n- Source Han Serif 思源宋体 [官方网站](https://github.com/adobe-fonts/source-han-serif/releases)\n\n  下载 Static Super OTC 解压后双击安装\n\n- Inconsolata, Roboto\n\n  ```bash\n  brew install font-inconsolata font-roboto\n  ```\n\n## powerlevel10k\n\n- [官方网站](https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#oh-my-zsh)\n\n- 安装字体\n\n  ```bash\n  brew install font-meslo-for-powerlevel10k\n  ```\n\n- 通过 oh-my-zsh 安装(推荐)\n\n  ```bash\n  git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k\n  ```\n\n  Set `ZSH_THEME=\"powerlevel10k/powerlevel10k\"` in `~/.zshrc`.\n\n- 初始化\n\n  ```bash\n  p10k configure\n  ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicunic%2Fmacos-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchicunic%2Fmacos-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicunic%2Fmacos-init/lists"}