个人环境配置仓库,主要包含三部分:
Debian/:Debian / Ubuntu 新机器初始化脚本macOS/:macOS 下使用的zsh和 Ghostty 配置Xray/:Xray 客户端配置示例
.
├── Debian/
│ └── init.sh
├── macOS/
│ ├── .zshrc
│ └── ghostty/
│ └── config
└── Xray/
└── config.json.example
Debian/init.sh 用于初始化一台新的 Debian / Ubuntu 机器。
特点:
- 支持
Ubuntu 24.04+和Debian 13+ - 需要以
root或sudo运行 - 如果通过
sudo运行,优先配置SUDO_USER;否则配置root - 已安装的软件会自动跳过
- 单个步骤失败后会继续执行,最后统一汇总失败项
- 可选安装
Docker和LazyDocker - 可选切换
apt源到中科大镜像 - 可选为脚本执行过程和生成的
~/.zshrc启用代理
代理参数:
- HTTP / HTTPS:
http://127.0.0.1:10809 - SOCKS5:
socks5://127.0.0.1:10808 NO_PROXY:127.0.0.1,localhost,::1
脚本会安装一组常用工具,包括:
batbtopbubblewrapca-certificatescurlezafd-findfzfgitjqripgrepwgetzoxidezshunzipzstdzsh-autosuggestionszsh-syntax-highlightingoh-my-zshuvpixibunLazyGitMicrosoft Edit
脚本还会写入目标用户的 ~/.zshrc,包含:
- 代理函数
proxy/unproxy - 常用
PATH oh-my-zshuv/uvx补全zoxide- 常用别名
使用方式:
cd Debian
sudo ./init.sh [OPTIONS]
exec zsh可选参数:
--proxy Enable proxy environment only, without installing Xray
--docker Install Docker and LazyDocker
--ustc Switch Debian/Ubuntu apt sources to USTC mirror
-h, --help Show help messagemacOS/ 目录保存我在 macOS 上使用的终端与 Shell 配置。
当前配置包含:
- 使用 Homebrew 安装的
edit作为默认编辑器 - 默认启用本地代理
- 增加用户本地二进制目录和 Android SDK
platform-tools - 启用
oh-my-zsh - 启用
uv/uvx补全 - 增加
bun的 PATH - 启用
zoxide - 提供
eza、bat、目录跳转等常用别名 - 启用
zsh-autosuggestions和zsh-syntax-highlighting
当前 Ghostty 配置包含:
- 字体:
Maple Mono NF CN - 主题:
Vercel - 半透明背景
- 自定义窗口内边距
- 启用部分 shell integration
macOS-option-as-alt键绑定