_(°:з」∠)_/Windows 系统配置流程

Created Mon, 08 Jan 2024 00:00:00 +0000
936 Words

系统

WSL 配置参考 NixOS 中文社区

## 启用 WSL2
wsl --install --no-distribution

下载最新的 nixos-wsl.tar.gz。参考 Quick start

## 导入系统文件
wsl --import NixOS C:\NixOS nixos-wsl.tar.gz --version 2
## 设 NixOS 为默认启动发行版
wsl -s NixOS
## 引导至 NixOS
wsl -d NixOS
## 在 wsl 内部更新 channel
sudo nix-channel --update
## 构建系统
nix-shell -p git
git clone https://github.com/fyang93/nixos-wsl.git
cd nixos-wsl
sudo nixos-rebuild switch --flake ".#nixos"

软件

## Dev
winget install -e --id Microsoft.VisualStudioCode
winget install -e --id Git.Git

## IM
winget install -e --id Tencent.WeChat
winget install -e --id SlackTechnologies.Slack
winget install -e --id Telegram.TelegramDesktop

## Work
winget install -e --id Tencent.TencentMeeting
winget install -e --id JabRef.JabRef

## Game
winget install -e --id Valve.Steam

## Tools
winget install Microsoft.PowerToys --source winget
winget install -e --id PixPin.PixPin

代理

参考这篇设置全局透明代理。

软件目录

在用户主目录下新建一个Softwares文件夹,并且设置中文名称。用于放置绿色软件。

$customPath = "$env:HOMEPATH\Softwares"
$desktopIniPath = "$customPath\desktop.ini"

New-Item -Path $customPath -ItemType Directory
@"
[.ShellClassInfo]
LocalizedResourceName=软件
IconResource=C:\Windows\System32\SHELL32.dll,2
"@ | Out-File -FilePath $desktopIniPath -Encoding Default -Force

attrib +h +s $desktopIniPath
attrib +s $customPath

终端配置

在终端设置->启动(快捷键:ctrl+,)中修改默认终端应用程序为预览版。 在终端设置的左下角打开JSON文件(快捷键:ctrl+shift+,),在profiles->default下添加:

"opacity": 75,
"useAcrylic": true

安装catppuccin主题。在终端设置->配置文件->默认值->外观中选择配色方案。

可选:根据该issue安装支持powerline字符的字体,前往release页面下载并安装带PL结尾的.ttf字体即可,在终端设置->配置文件->默认值->外观->字体中选择Cascadia Mono PL

小狼毫配置

在桌面创建小狼毫服务器快捷方式(当前版本自启动异常):

$shell = New-Object -ComObject WScript.Shell

$targetName = "WeaselServer.exe"
$shortcutName = "WeaselServer.lnk"
$targetPath = Join-Path -Path ${env:PROGRAMFILES(X86)} -ChildPath "Rime\weasel-0.15.0\$targetName"
$shortcutPath = Join-Path -Path $shell.SpecialFolders("Desktop") -ChildPath "$shortcutName"

$shortcut = $shell.CreateShortcut($shortcutPath)
$shortcut.TargetPath = $targetPath
$shortcut.Save()

链接小狼毫自定义配置:

Remove-Item -Path "$env:APPDATA\Rime" -Recurse -Force
git clone https://github.com/fyang93/rime "$env:APPDATA\Rime"

在 WSL 中创建符号链接,方便编辑配置:

ln -s /mnt/c/Users/fyang/AppData/Roaming/Rime/ ~/rime

JabRef 配置

浏览器插件导入文献时反复出现"Error connecting to JabRef",解决方案是修改位于C:\Program Files\JabRef\JabRefHost.ps1的脚本39-40行,由

$output = & $jabRefExe -importToOpen $tempfile *>&1
Remove-Item $tempfile

修改为

$output = & $jabRefExe -importToOpen $tempfile *>$null
Remove-Item $tempfile *>$null

默认的CitationKey模式是[auth][year],实际使用体验非常糟糕,不能从键值看出来是哪篇论文,在 文件->首选项->CitationKey->CitationKey样式 中将Default pattern改为[auth][year][veryshorttitle]即可。