A comprehensive collection of dotfiles, shell scripts, environment configurations, and automation tools for Linux (Manjaro, Debian, CentOS Stream, Ubuntu), macOS, Windows (PowerShell, WSL2, MSYS2), and Android (Termux).
Warning
Use at your own risk! These scripts are tested primarily on my personal workstations, laptops, and cloud servers. They may not cover every edge case. Make sure to conduct thorough testing before running these scripts in a production environment. Best Practice: Create a full system backup or prepare a live boot disk prior to execution.
- Primary Workstation OS: Manjaro Linux (KDE Plasma)
- Server Distributions: Debian, CentOS Stream
- Windows Environment: Windows 11 with WSL2 (Debian) & PowerShell 7
- Shell: Zsh managed via Oh My Zsh.
- Prompt Themes:
ystheme for headless / server environments.- Oh My Posh for desktop environments (KDE, GNOME, XFCE, WSL).
- Theme switcher script (/zsh/zsh_change_theme.sh) supporting
ys, agnosterzak, agkozak, alien, powerlevel10k, and spaceship.
- Zsh Plugins: Automatic updates (/zsh/zsh_update.sh) for
zsh-syntax-highlighting,zsh-autosuggestions,fast-syntax-highlighting,fzf-tab,fzf-tab-completion,forgit,fuzzy-sys,powerlevel10k, etc. - Terminal Multiplexers: Auto-start SSH session multiplexing with Zellij, Oh My Tmux, or
Screen. - Universal Package Management: Pacman-style syntax wrapper via pacaptr and pacapt.
- Modern CLI Tools Integration: Integrated installation and setup for fastfetch, jq, fzf, and other Modern Unix utilities.
- public.sh: Colored echo outputs, version comparison functions.
- system.sh: Cron job management, systemd service setup, Snapper backup snapshot controls.
- osinfo.sh: OS detection, architecture info, release versioning, package manager detection, desktop icons, virtualization detection.
- network.sh: IPv4/IPv6 utility functions, URL handling, web service health checks.
- proxy.sh: Environment-wide proxy getters and setters.
- git.sh: Git repository cloning and updating utilities:
# Clone or update a repository (default host: https://github.com/) Git_Clone_Update "username/repository" "$HOME/repository" Git_Clone_Update "https://gitlab.com/username/repository" "$HOME/repository" Git_Clone_Update "git@github.com:username/repository.git" "$HOME/repository" # Clone or update a specific branch Git_Clone_Update_Branch "https://github.com/username/repository" "$HOME/repository" Git_Clone_Update_Branch "username/repository" "$HOME/repository" "https://github.com" "dev" # Update all subdirectories containing Git repositories Git_Update_Repo_in_SubDir "$ZSH/custom"
- docker.sh: Registry mirror configurations and multi-image pull helpers.
- installer.sh: Application installation utilities with automatic release resolution.
- versions.sh: Multi-version manager integrations (goup, mise, asdf, etc.).
- env.sh: Environment variable auto-loader for Snap, Homebrew, PHP, Java, Go, Flutter, Rust, Python, Node version managers, Ruby, Krew, Oracle Instant Client, etc.
- Additional modules: web.sh, misc.sh.
- Smart URL Resolution: Automatically fetches release binaries matching system architecture (x86_64, arm64, etc.) directly from GitHub releases or custom URLs.
- Accelerated Downloads: Uses
axelfor multi-threaded downloads with automatic failover tocurl. - Automated Installation: Extracts executable binaries, man pages, and Zsh completion files directly into system paths (
/usr/local/bin,/usr/share/man,/usr/local/share/zsh/site-functions).# Prebuilt Binary Installation installPrebuiltBinary rclone "rclone/rclone" installPrebuiltBinary nnn "jarun/nnn" "nnn-nerd-.*\.tar\.gz" installPrebuiltBinary earthly "earthly/earthly" "earthly-*" installPrebuiltBinary "https://dev.yorhel.nl/ncdu" "/download/ncdu-[^<>:;,?\"*|/]+\.tar\.gz" "ncdu-.*\.tar\.gz" # Build from Source Installation installBuildBinary sd sd cargo installBuildBinary fvm fvm brew installBuildBinary protoc-gen-go protoc-gen-go go "google.golang.org/protobuf/cmd/protoc-gen-go@latest"
- Preconfigured Regional Mirrors: Speeds up downloads in restricted network environments (overrideable via
~/.dotfiles.env.local):- Homebrew: USTC mirrors (
homebrew-bottles,homebrew-core,homebrew-cask). - Docker Registry: Custom registry mirrors list.
- Node.js: fnm, nvm, and nvs using
npmmirror.com. - Go:
goproxy.cn. - Rust:
rsproxy.cn. - Python/pip: Aliyun & SUSTech PyPI mirrors.
- Anaconda: SJTU Anaconda mirror.
- Flutter:
pub.flutter-io.cnandstorage.flutter-io.cn.
- Homebrew: USTC mirrors (
The system update script (/zsh/zsh_upgrade_all_packages.sh) standardizes updates across OS package managers and runtime version managers:
- Native package managers (
pacman,apt,dnf,yum) - Homebrew, Flatpak, Snap
- Version managers:
sdkman,conda,goup,rustup,nvm,nvs,asdf,mise,jabba,version-fox(vfox),version-manager(vmr).
Create ~/.dotfiles.env.local to customize environment variables, proxy settings, git defaults, download options, mirrors, and package lists:
# Global Network Proxy Setup (Default: 127.0.0.1:7890)
GLOBAL_PROXY_IP="127.0.0.1"
GLOBAL_PROXY_SOCKS_PROTOCOL="socks5"
GLOBAL_PROXY_SOCKS_PORT="7890"
GLOBAL_PROXY_MIXED_PORT="7890"
NO_PROXY_LIST=("127.0.0.1" "::1" "localhost" ".corp" ".internal" ".local" ".localdomain")
# Git Default Options
GIT_CLONE_DEFAULT_OPTION="-c core.autocrlf=false -c core.filemode=false"
# Installer Download Options
INSTALLER_CHECK_CURL_OPTION="-fsL --connect-timeout 5"
INSTALLER_DOWNLOAD_CURL_OPTION="-fSL --connect-timeout 5"
INSTALLER_DOWNLOAD_AXEL_OPTION="--num-connections=5 --timeout=30 --alternate"
# GitHub Mirror URLs & API Token
GITHUB_HUB_URL="https://github.com"
GITHUB_DOWNLOAD_URL="https://github.com"
GITHUB_RAW_URL="https://raw.githubusercontent.com"
GITHUB_API_TOKEN=""
# Package Mirrors Configuration
USE_MIRROR_WHEN_BLOCKED="true"
MIRROR_PACKAGE_MANAGER_APT="mirrors.sustech.edu.cn"
MIRROR_ARCHLINUX_CN="https://mirrors.sustech.edu.cn"
MIRROR_CENTOS_STREAM="https://mirrors.aliyun.com/centos-stream"
MIRROR_ROCKYLINUX="https://mirrors.aliyun.com/rockylinux"
MIRROR_EPEL_RELEASE="https://mirrors.aliyun.com"
HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
MIRROR_FLATPAK_URL="https://mirrors.ustc.edu.cn/flathub"
GOUP_GO_HOST="golang.google.cn"
MIRROR_GO_PROXY="https://goproxy.cn,direct"
MIRROR_GO_SUMDB="sum.golang.google.cn"
PUB_HOSTED_URL="https://pub.flutter-io.cn"
FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn"
RUSTUP_DIST_SERVER="https://rsproxy.cn"
RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"
MIRROR_RUST_CARGO="rsproxy-sparse"
MIRROR_NODEJS_REGISTRY="https://registry.npmmirror.com"
NVM_NODEJS_ORG_MIRROR="https://npmmirror.com/mirrors/node"
NVS_NODEJS_ORG_MIRROR="https://npmmirror.com/mirrors/node"
PYTHON_PIP_CONFIG="$HOME/.pip/pip.conf"
MIRROR_PYTHON_PIP_URL="https://mirrors.sustech.edu.cn/pypi/web/simple"
MIRROR_PYTHON_CONDA="mirrors.sustech.edu.cn"
RUBY_BUILD_MIRROR_URL="https://cache.ruby-china.com"
RUBY_GEM_SOURCE_MIRROR="https://gems.ruby-china.com/"
# Application Installation Playlists
AppAlwaysInstallList=("asdf" "mise" "as-tree" "bat" "broot" "croc" "dasel" "duf" "dust" "erdtree" "eza" "fd" "git-delta" "lazygit" "lnav" "magic-wormhole" "navi" "nnn" "tealdeer" "yq" "zoxide")
AppWSLDesktopList=("bottom" "btop" "choose" "curlie" "distrobox" "dog" "fq" "fx" "git-lfs" "gotty" "httpie" "httpie-go" "httpstat" "hyperfine" "lsd" "nali" "ncdu" "nu" "onefetch" "ohmyposh" "poetry" "procs" "pup" "rclone" "re-txt" "restic" "sd" "tig" "usql" "viu" "wrk" "xh")
AppUpdateOnlyList=("frp" "goproxy" "he3" "safe-rm" "mihomo" "mieru" "mita" "subconverter" "sing-box" "flutter")- BTRFS Filesystem Workflow:
- Package Backends: Snap, Flatpak, AUR enabled out-of-the-box.
- Backup & Recovery:
Snappersnapshot integration paired with GRUB boot items. - Desktop Workstation Setup:
- Automated installation via manjaro_setup.sh.
- Samba file sharing, SmartDNS server configuration.
- CJK fonts & Fcitx5 input engine integration.
- Comprehensive Rime Input Method schemas:
- Frost Pinyin (白霜拼音)
- Ice Pinyin (雾凇拼音)
- Luna Pinyin (朙月拼音)
- Cantonese Jyutping (粵語拼音)
- Wubi 86 (五筆字型 86 版)
- Bopomofo / Zhuyin (注音)
- Cangjie (倉頡)
- Moqi Phonetic-Shape (墨奇音形)
- Quanpin, Shuangpin variants (Flypy, Xiaohe 9-Key, Zirancode, MS, Sogou), Wubi variants (QQ 86, Wubi-Pinyin, Jidian), Emoji, Middle Chinese, IPA, Xuma, Zhengma, etc.
- Emoji keyboard integration & CUPS printer/scanner services.
- KVM & QEMU virtualization environment.
- Conky Themes: Top-right
Hybriddesktop widget, bottom-left weather info powered by wttr.in (weather_wttr.sh). - Seamless Windows application execution via Cassowary and WinApps.
- Arch Linux Chinese Community Repository (archlinuxcn) mirror setup and AUR PKGBUILD acceleration.
- Debian Major Version Upgrades:
- CentOS Stream Upgrades:
- Windows Terminal & PowerShell 7 support.
- PowerShell Profile & Custom Modules:
Find-String,Posh-git,Terminal-Icons,PSEverything,PSFzf,Get-ChildItemColor,PoshFunctions. - Prompt Theme: Oh My Posh with Unix-style key bindings (Microsoft.PowerShell_profile.ps1).
- Fuzzy Tab Completion: Powered by
PSFzf. - Package Management: Scoop automation script (scoop_install_apps.ps1) supporting standard apps, elevated apps (
$sudoApps), and elevated fonts ($sudoFonts). - Environment Configuration (
~/.powershell.env.ps1): Network proxy setup, GitHub mirror options, and custom helper functions (ps_custom_function.ps1). - WSL2 Integration (
/wsl/):- Automated initialization based on Debian (wsl2_init.sh).
- Host IP mapping helper script (wsl2-map-win-localhost.sh).
- MSYS2 Environment (
/msys2/): Scripts and configuration setups for MSYS2.
- Android / Termux (
/termux_init.sh): Termux initialization script with shell tools and package environment. - Node.js Development Environment (
/nodejs/):pnpm,npm-check-updates, version management viafnm/nvm/nvs, and a lightweight file server (simpleserver). - NAS & OpenWrt (
/nas/): OpenWrt network and storage utility scripts. - Kubernetes (
/k8s/): Helper scripts for local and remote Kubernetes cluster management. - CJK Text Optimization Tampermonkey Script (
/cjk/): Web user script for auto-selecting locale fonts (SC, TC, HK, JP, KR, Emoji), adding spaces between CJK and Latin text, removing hidden obfuscated characters, prettifying code blocks, and exporting inspected elements to screenshots or Markdown.
# Arch Linux / Manjaro
sudo pacman -S curl git
# Debian / Ubuntu
sudo apt-get update && sudo apt-get install -y curl git
# RHEL / Fedora / CentOS Stream
sudo dnf install -y curl gitsource <(curl -fsSL --connect-timeout 5 --max-time 15 https://git.io/JPSue)Alternatively:
curl -fsSL --connect-timeout 5 --max-time 15 https://git.io/JPSue | bash "$HOME/.dotfiles""${MY_SHELL_SCRIPTS:-$HOME/.dotfiles}/zsh/zsh_installer.sh"chsh -s "$(which zsh)""${MY_SHELL_SCRIPTS:-$HOME/.dotfiles}/zsh/zsh_upgrade_all_packages.sh" && "${MY_SHELL_SCRIPTS:-$HOME/.dotfiles}/zsh/zsh_init.sh"- Install Windows Terminal & PowerShell 7 (Built-in on Windows 11; installable via Microsoft Store / GitHub on Windows 10).
- Open PowerShell as Administrator.
- Download scripts to
~\Documents\PowerShell\Scripts:curl -fsSL -o "~\pwsh_script_download.ps1" "https://git.io/JPS2j" && ~\pwsh_script_download.ps1
- Initialize PowerShell profile:
~\Documents\PowerShell\Scripts\Powershell_init.ps1
- Batch install applications and fonts via Scoop:
Edit
~\Documents\PowerShell\Scripts\scoop_install_apps.ps1to configure$Apps,$sudoApps, and$sudoFonts, then execute:~\Documents\PowerShell\Scripts\scoop_install_apps.ps1
- Install a WSL distribution (e.g. Debian):
wsl --list --online wsl --install -d Debian wsl --update
- Launch the WSL distribution and follow the Installation on Linux section above.
To update the dotfiles repository and all managed system packages:
source <(curl -fsSL --connect-timeout 5 --max-time 15 https://git.io/JPSue) && "${MY_SHELL_SCRIPTS:-$HOME/.dotfiles}/zsh/zsh_upgrade_all_packages.sh"# Check outdated dependencies
npm outdated
# Upgrade dependencies within semver constraints
npm update
# Upgrade to latest major version
npm install <packagename>@latest
# Upgrade all dependencies globally via npm-check
npm install -g npm-check
npm-check -u -yTo install Commitizen helper rules:
"${MY_SHELL_SCRIPTS:-$HOME/.dotfiles}/commitizen-relax_installer.sh"Distributed under the MIT License.