refactor: remove hardcoded personal identifiers from tracked files

This commit is contained in:
2026-06-15 19:39:59 +08:00
parent 0cae2d0fd9
commit b6923d4f35
3 changed files with 24 additions and 15 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ Required software:
`git`; `fzf`; `zoxide`; `python`; `starship`
```shell
git clone https://gitea.meip.work/gwbeip/TerminalPolyjuice.git $HOME/.TerminalPolyjuice
git clone <repository-url> $HOME/.TerminalPolyjuice
cd $HOME/.TerminalPolyjuice/zsh
zsh polyjuice.sh install_ohmyzsh config_starship check
```
+11 -11
View File
@@ -1,11 +1,11 @@
# Configure New Archlinux in WSL
## Add user `gwb`
## Add user `<username>`
```shell
cd
pacman -Syu
useradd -m gwb
useradd -m <username>
```
run
@@ -16,11 +16,11 @@ to set a password for `root`
run
```shell
passwd gwb
passwd <username>
```
to set a password for user `gwb`
to set a password for user `<username>`
## Add user `gwb` into group `sudo`
## Add user `<username>` into group `sudo`
```shell
pacman -S sudo
@@ -29,7 +29,7 @@ pacman -S vim
edit `/etc/sudoers`
uncomment `%wheel ALL=(ALL:ALL) ALL`
```shell
usermod -aG wheel gwb
usermod -aG wheel <username>
```
## Install and configure `ZSH`
@@ -41,12 +41,12 @@ pacman -S fzf
pacman -S zoxide
pacman -S starship
pacman -S python
su gwb
su <username>
cd
git clone https://gitea.meip.work/gwbeip/TerminalPolyjuice.git $HOME/.TerminalPolyjuice
git clone <repository-url> $HOME/.TerminalPolyjuice
chsh -s /bin/zsh
exit
su gwb
su <username>
cd
mkdir .config
cd $HOME/.TerminalPolyjuice/zsh
@@ -55,7 +55,7 @@ zsh polyjuice.sh install_ohmyzsh config_starship check
add the contents in `$HOME/.TerminalPolyjuice/zsh/zshenv` into `$HOME/.zshenv`
# Set `gwb` as default user
# Set `<username>` as default user
```shell
wsl --manage archlinux --set-default-user gwb
wsl --manage archlinux --set-default-user <username>
```
+12 -3
View File
@@ -1,7 +1,16 @@
# "[interop] appendWindowsPath=false" in /etc/wsl.conf is setted
# Append VSCode on Windows into PATH so that vscode can be used in WSL
export PATH=$PATH:'/mnt/c/Users/gwbei/AppData/Local/Programs/Microsoft VS Code/bin/'
export PATH=$PATH:'/mnt/c/Users/gwbei/AppData/Local/Programs/Zed/bin/zed'
# Dynamically resolve Windows-side program paths (avoids hardcoding usernames)
if [[ -n "$WSLENV" ]]; then
_win_user=$(cmd.exe /c "echo %USERNAME%" 2>/dev/null | tr -d '\r\n')
if [[ -n "$_win_user" ]]; then
_win_home="/mnt/c/Users/$_win_user"
_vscode_bin="$_win_home/AppData/Local/Programs/Microsoft VS Code/bin"
_zed_bin="$_win_home/AppData/Local/Programs/Zed/bin"
[[ -d "$_vscode_bin" ]] && export PATH="$PATH:$_vscode_bin"
[[ -d "$_zed_bin" ]] && export PATH="$PATH:$_zed_bin"
fi
unset _win_user _win_home _vscode_bin _zed_bin
fi
# Language and encoding related
export LC_ALL=C.UTF-8