电脑软装记录

#电脑 #Windows 2024/08/12 23:48:44
目录
  1. 系统
    1. 系统安装
    2. 驱动安装
    3. 启用 Windows 功能
    4. 安装 Linux 子系统 - WSL
    5. 安装 Android 子系统 - WSA
    6. 设置输入法 — 小鹤双拼
  2. 终端
    1. Windows 终端
    2. Linux 终端
    3. WSL
  3. 软件
    1. 开发
    2. 工具

系统

系统安装

Windows 官网下载镜像,使用 rufus 做启动盘 (选择跳过登录登录以及禁止 Bitlocker 加密磁盘)。

CAUTION

如果在 Windows 初始化中登录微软账号,微软会默认以账户邮箱的前五位作为用户名,并且有可能自动为你加密磁盘。

TIP

Rufus 在制作 Windows 启动盘时会提供选项帮助跳过账户登录,如果过程中出现强制登录微软账号,也可以输入no@thankyou + 随意密码 跳过登录。

驱动安装

主板官网下载驱动,不使用第三方驱动下载软件。

以微星主板为例,在 微星科技 下载对应的主板驱动。在实际操作中,只需要下载网卡驱动确保网络连接后,微星主板在电脑启动后会自动弹出驱动安装程序,直接安装所需要的驱动。

启用 Windows 功能

设置/系统/可选功能/更多 Windows 功能 启用 Windows 沙盒 / 适用于 Linux 的 Windows 子系统 / 虚拟机平台

安装 Linux 子系统 - WSL

使用 wsl 命令安装子系统

wsl --install
wsl --version
wsl #启动

安装 Android 子系统 - WSA

克隆 github 仓库 GitHub - LSPosed/MagiskOnWSALocal: Integrate Magisk root and Google Apps into WSA (Windows Subsystem for Android),在已安装 WSL 的前提条件下安装 WSA。

设置输入法 — 小鹤双拼

GitHub - 2015WUJI01/xhup-for-win10: 小鹤双拼方案 for win10 自带输入法

  1. 右键开始 → 运行 ( Win + R ):Regedit(注册表编辑器)

  2. 定位计算机 \HKEY_CURRENT_USER\Software\Microsoft\InputMethod\Settings\CHS

  3. 右键 → 新建字符串值

  4. 数值名称: UserDefinedDoublePinyinScheme0

  5. 数值数据: 小鹤双拼*2*^*iuvdjhcwfg^xmlnpbksqszxkrltvyovt

终端

Windows 终端

Linux 终端

  • zsh / oh my zsh

    sudo apt install zsh # 安装 zsh
    chsh -s $(which zsh) # 启用 zsh
    
    echo $SHELL # 检测当前 shell
    
    ZSH="/usr/local/share/oh-my-zsh" sh -c "$(curl -fsSL https://install.ohmyz.sh/)" # 自定义安装 oh-my-zsh
    
    echo $ZSH # 查看 oh my zsh 安装目录

    为了统一所有用户的 zsh 配置一致,在/etc/zsh/ 目录下配置 zshrc

     # 配置 oh my zsh 地址 (默认地址~/.oh-my-zsh)
    export ZSH="/usr/local/share/oh-my-zsh"
    
    source $ZSH/oh-my-zsh.sh
    
    # 插件
    plugins=(
      adb
      git
      z
      docker
      nvm
      pip
      sudo
      safe-paste
      zsh-autosuggestions
      zsh-syntax-highlighting
      )
    
    # 配置 starship
    eval "$(starship init zsh)"
    # starship 配置目录
    export STARSHIP_CONFIG=/usr/local/etc/.config/starship.toml
  • 安装 zsh 插件

    # zsh-autosuggestions
    git clone https://github.com/zsh-users/zsh-autosuggestions /usr/local/share/oh-my-zsh/plugins
    # zsh-syntax-highlighting
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /usr/local/share/oh-my-zsh/plugins
  • 设置终端主题 — starship

    # 安装
    curl -sS https://starship.rs/install.sh | sh
    
    # 配置文件 /usr/local/etc/.config/starship.toml
    # 自定义配置文件,需要设置环境变量 STARSHIP_CONFIG
    
    # 设置配置范例,开启编辑器的自动补全
    
    "$schema" = 'https://starship.rs/config-schema.json'
    
    # 在命令之间插入空行
    
    add_newline = true
    
    format = "$os$time$username$all"
    
    # 将提示符的“❯”替换为“➜”
    
    [character] # “character”是我们正在配置的组件
    success_symbol = "[➜ ](bold green)" # 设置“success_symbol”字段为绿色加粗的“➜”
    error_symbol = "[✗](bold red)"
    
    # 禁用 package 组件,完全隐藏它的提示符
    
    [package]
    disabled = true
    
    [os]
    disabled = false
    
    [time]
    disabled = false
    format = "[$time]($style) "
    
    [git_branch]
    symbol = " "
    style = "dimmed purple"
    
    [git_status]
    disabled = true
    
    [directory]
    style = "italic cyan"
    truncation_length = 6
    truncation_symbol = "../"
    
    [nodejs]
    format = "via [🤖 $version](bold green) "
    
    [memory_usage]
    disabled = false
    threshold = -1
    format = '$symbol[${ram_pct}]($style) '
    
    [username]
    style_user = "blue"
    style_root = "red"
    format = "[$user]($style) in "
    disabled = false
    show_always = true

WSL

  • 同步 WSL git 与 Windows git credentials 同步

    git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"

软件

开发

工具

Windows 商店即可下载的软件

  • Apple Music

  • PowerShell

  • PowerToys

  • Bandzip